]> granicus.if.org Git - curl/commitdiff
cookie: avoid NULL dereference
authorDaniel Stenberg <daniel@haxx.se>
Mon, 30 Oct 2017 15:42:25 +0000 (16:42 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 31 Oct 2017 08:16:03 +0000 (09:16 +0100)
... when expiring old cookies.

Reported-by: Pavel Gushchin
Fixes #2032
Closes #2035

lib/cookie.c

index 271f6d49d38c7a8087626a41644e969b17da5aff..c7afc7ae34bdaeb8fb665319b3804fdf53ddb825 100644 (file)
@@ -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 {