1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 07:38:49 -05:00

cookie: avoid NULL dereference

... when expiring old cookies.

Reported-by: Pavel Gushchin
Fixes #2032
Closes #2035
This commit is contained in:
Daniel Stenberg 2017-10-30 16:42:25 +01:00
parent 52d9a11c1c
commit fa394c8c2e

View File

@ -309,7 +309,7 @@ static void remove_expired(struct CookieInfo *cookies)
while(co) { while(co) {
nx = co->next; nx = co->next;
if(co->expires && co->expires < now) { if(co->expires && co->expires < now) {
if(co == cookies->cookies) { if(!pv) {
cookies->cookies = co->next; cookies->cookies = co->next;
} }
else { else {