diff options
author | Daniel Stenberg <daniel@haxx.se> | 2019-12-12 10:48:57 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2019-12-12 10:48:57 +0100 |
commit | 5d897ba2ef01a38acc33b31c391c82c1ff533ac8 (patch) | |
tree | a1c9d29c0ffc968e642be54e66795d1bd5a9d949 | |
parent | 4940bb85689bbe91df277cce864e2b59b4f5cadb (diff) | |
download | curl-bagder/altsvc-torture.tar.gz |
altsvc: make the save function ignore NULL filenamesbagder/altsvc-torture
It might happen in OOM situations. Detected bv torture tests.
-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) |