]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cookie: avoid fopen with empty file name
authorDmitry Karpov <dkarpov@roku.com>
Wed, 13 Dec 2023 22:32:53 +0000 (14:32 -0800)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 13 Dec 2023 23:15:57 +0000 (00:15 +0100)
Closes #12514

lib/cookie.c

index 1bd80ff5b3e5b3e6b0e240fe6a7df576689cd76f..5f158395b6f6f34ced17a201f158fc99d6bc57cf 100644 (file)
@@ -1227,7 +1227,7 @@ struct CookieInfo *Curl_cookie_init(struct Curl_easy *data,
 
   if(data) {
     FILE *fp = NULL;
-    if(file) {
+    if(file && *file) {
       if(!strcmp(file, "-"))
         fp = stdin;
       else {