#1043340 curl -D /foo/bar/baz segfaults instead of exiting with error

Package:
curl
Source:
curl
Description:
command line tool for transferring data with URL syntax
Submitter:
Date:
2023-08-14 09:54:06 UTC
Severity:
normal
#1043340#5
Date:
2023-08-09 10:27:19 UTC
From:
To:
Dear Maintainer,

   * What led up to the situation?

Nothing in particular.

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

curl -D /foo/bar/baz https://www.gnus.org

   * What was the outcome of this action?

segfault with the following stack trace:

#0  0x00007ffff7d784f4 in _IO_new_fclose (fp=0x0) at ./libio/iofclose.c:48
#1  0x000055555556ca23 in single_transfer (global=global@entry=0x7fffffffe5c0,
    config=0x5555555b4190, share=share@entry=0x5555555c55c0,
    capath_from_env=false, added=0x7fffffffe550)
    at ./debian/build/src/tool_operate.c:987
#2  0x000055555556eba0 in transfer_per_config (
    global=global@entry=0x7fffffffe5c0, config=<optimized out>,
    share=share@entry=0x5555555c55c0, added=added@entry=0x7fffffffe550)
    at ./debian/build/src/tool_operate.c:2607
#3  0x000055555556f751 in create_transfer (added=0x7fffffffe550,
    share=0x5555555c55c0, global=0x7fffffffe5c0)
    at ./debian/build/src/tool_operate.c:2623
#4  serial_transfers (share=0x5555555c55c0, global=0x7fffffffe5c0)
    at ./debian/build/src/tool_operate.c:2433
#5  run_all_transfers (result=CURLE_OK, share=0x5555555c55c0,
    global=0x7fffffffe5c0) at ./debian/build/src/tool_operate.c:2648
#6  operate (global=global@entry=0x7fffffffe5c0, argc=argc@entry=4,
    argv=argv@entry=0x7fffffffe798) at ./debian/build/src/tool_operate.c:2762
#7  0x000055555555f9e2 in main (argc=4, argv=0x7fffffffe798)
    at ./debian/build/src/tool_main.c:283

   * What outcome did you expect instead?

Some file-related error message (ENOENT).

#1043340#10
Date:
2023-08-13 20:02:47 UTC
From:
To:
Hello,

Thank you for reporting this.

I could not reproduce with version 8.2.1-1 from testing, and I see that you
were running testing when you reported the issue but it was before this version
migrated.

Can you please check if the same happens for you with an updated curl package?

I sill want to give it a go at reproducing this on stable, but wanted to check
with you whether the latest version fixes the issue.

Thank you,

#1043340#15
Date:
2023-08-14 09:42:35 UTC
From:
To:
Hi Samuel,

I can confirm that with version 8.2.1-1, installed today from Debian testing, the segfault is *not* seen any longer.

As expected, I get now a regular file error when I specify an invalid path to option "-D".

Feel free to close this bug.

Thanks