mirror of
https://github.com/moparisthebest/curl
synced 2025-01-11 05:58:01 -05:00
curl: Fix segfault when -H @headerfile is empty
The curl binary would crash if the -H command line option was given a filename to read using the @filename syntax but that file was empty. Closes #2797
This commit is contained in:
parent
d390541944
commit
3e9b3a3798
@ -1706,7 +1706,7 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
||||
warnf(global, "Failed to open %s!\n", &nextarg[1]);
|
||||
else {
|
||||
err = file2memory(&string, &len, file);
|
||||
if(!err) {
|
||||
if(!err && string) {
|
||||
/* Allow strtok() here since this isn't used threaded */
|
||||
/* !checksrc! disable BANNEDFUNC 2 */
|
||||
char *h = strtok(string, "\r\n");
|
||||
|
Loading…
Reference in New Issue
Block a user