mirror of
https://github.com/curl/curl.git
synced 2026-07-31 11:38:06 +03:00
curl: fix segmentation fault for empty output file names.
Function glob_match_url set *result to NULL when called with filename = "", producing an indirect NULL pointer dereference. Closes #8606
This commit is contained in:
parent
a6c3b7d6f5
commit
9e5bd9ba19
3 changed files with 13 additions and 1 deletions
|
|
@ -2043,6 +2043,10 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
|
|||
|
||||
/* fill in the outfile */
|
||||
if('o' == letter) {
|
||||
if(!*nextarg) {
|
||||
warnf(global, "output file name has no length\n");
|
||||
return PARAM_BAD_USE;
|
||||
}
|
||||
GetStr(&url->outfile, nextarg);
|
||||
url->flags &= ~GETOUT_USEREMOTE; /* switch off */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue