]> granicus.if.org Git - curl/commitdiff
cookies: expire "Max-Age=0" immediately
authorDaniel Stenberg <daniel@haxx.se>
Sat, 8 Dec 2018 16:29:55 +0000 (17:29 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 9 Dec 2018 17:34:55 +0000 (18:34 +0100)
Reported-by: Jeroen Ooms
Fixes #3351
Closes #3352

lib/cookie.c

index d8655f7908fac583182d6c27f7f67800a4048d87..3dc85ee5caee1f361df1e21810a986563906f114 100644 (file)
@@ -675,7 +675,10 @@ Curl_cookie_add(struct Curl_easy *data,
         /* overflow, used max value */
         co->expires = CURL_OFF_T_MAX;
       else if(!offt) {
-        if(CURL_OFF_T_MAX - now < co->expires)
+        if(!co->expires)
+          /* already expired */
+          co->expires = 1;
+        else if(CURL_OFF_T_MAX - now < co->expires)
           /* would overflow */
           co->expires = CURL_OFF_T_MAX;
         else