Unverified Commit 3e9b3a37 authored by Tobias Blomberg's avatar Tobias Blomberg Committed by Daniel Stenberg
Browse files

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
parent d3905419
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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");