mirror of
https://github.com/moparisthebest/curl
synced 2025-02-28 09:21:50 -05:00
altsvc: make the save function ignore NULL filenames
It might happen in OOM situations. Detected bv torture tests. Closes #4707
This commit is contained in:
parent
70a6541515
commit
5dc56eb95d
@ -320,8 +320,8 @@ CURLcode Curl_altsvc_save(struct altsvcinfo *altsvc, const char *file)
|
||||
/* no cache activated */
|
||||
return CURLE_OK;
|
||||
|
||||
if((altsvc->flags & CURLALTSVC_READONLYFILE) || !file[0])
|
||||
/* marked as read-only or zero length file name */
|
||||
if((altsvc->flags & CURLALTSVC_READONLYFILE) || !file || !file[0])
|
||||
/* marked as read-only, no file or zero length file name */
|
||||
return CURLE_OK;
|
||||
out = fopen(file, FOPEN_WRITETEXT);
|
||||
if(!out)
|
||||
|
Loading…
x
Reference in New Issue
Block a user