1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-15 05:55:04 -05:00

cookies: expire "Max-Age=0" immediately

Reported-by: Jeroen Ooms
Fixes #3351
Closes #3352
This commit is contained in:
Daniel Stenberg 2018-12-08 17:29:55 +01:00
parent d997aa0e96
commit 1e9abfedfa
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View 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