diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-12-12 10:48:57 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-12-12 14:10:09 +0100 |
commit | 5dc56eb95d1a5d9ac4c35d1ad038d98731decab2 (patch) | |
tree | f1fdc27bc0d7ff1f5df46e6814fcc65907b14192 /lib/altsvc.c | |
parent | 70a654151515a3cd17b47884154b34a857e81db9 (diff) | |
download | curl-5dc56eb95d1a5d9ac4c35d1ad038d98731decab2.tar.gz |
altsvc: make the save function ignore NULL filenames
It might happen in OOM situations. Detected bv torture tests.
Closes #4707
Diffstat (limited to 'lib/altsvc.c')
-rw-r--r-- | lib/altsvc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/altsvc.c b/lib/altsvc.c index 28c9276b1..bf869c37a 100644 --- a/lib/altsvc.c +++ b/lib/altsvc.c @@ -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) |