If you try to use the -D/--dump-header <filename> option, curl curl will have a segmentation fault
if the file cannot be created (for instance if the target directory does not have the w permissions), for
instance:
$ valgrind ./curl -D hdr/headers.dump https://www.google.com
==10952== Memcheck, a memory error detector
==10952== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==10952== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==10952== Command: ./curl -D hdr/headers.dump https://www.google.com
==10952==
==10952== Invalid read of size 4
==10952== at 0x531D0D4: fclose <libc.so>
==10952== by 0x40E56F: single_transfer (tool_operate.c:987)
==10952== by 0x411E9D: transfer_per_config (tool_operate.c:2607)
==10952== by 0x411E9D: create_transfer (tool_operate.c:2623)
==10952== by 0x412894: serial_transfers (tool_operate.c:2433)
==10952== by 0x412894: run_all_transfers (tool_operate.c:2648)
==10952== by 0x412894: operate (tool_operate.c:2762)
==10952== by 0x4038B3: main (tool_main.c:283)
==10952== Address 0x0 is not stack'd, malloc'd or (recently) free'd
Steps to reproduce
If you try to use the
-D/--dump-header <filename>
option,curl
curl will have a segmentation faultif the file cannot be created (for instance if the target directory does not have the
w
permissions), forinstance:
I expected the following
On older versions of
curl
, it just prints an error message and exits with rcode 23(the below is what happens with version 7.29.0):
curl/libcurl version + operationg systems
I was able to reproduce with the following two setups:
curl
version 2.88.0:curl
version 2.88.1 (built from source):Note that I was NOT able to reproduce this using the windows binary (downloaded from the curl website)
The text was updated successfully, but these errors were encountered: