From: Daniel Stenberg Date: Mon, 30 Oct 2017 15:42:25 +0000 (+0100) Subject: cookie: avoid NULL dereference X-Git-Tag: curl-7_57_0~76 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fa394c8c2e39ea327d668f14353b32580e821b1c;p=curl cookie: avoid NULL dereference ... when expiring old cookies. Reported-by: Pavel Gushchin Fixes #2032 Closes #2035 --- diff --git a/lib/cookie.c b/lib/cookie.c index 271f6d49d..c7afc7ae3 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -309,7 +309,7 @@ static void remove_expired(struct CookieInfo *cookies) while(co) { nx = co->next; if(co->expires && co->expires < now) { - if(co == cookies->cookies) { + if(!pv) { cookies->cookies = co->next; } else {