summaryrefslogtreecommitdiff
path: root/lib/cookie.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-10-30 16:42:25 +0100
committerDaniel Stenberg <daniel@haxx.se>2017-10-31 09:16:03 +0100
commitfa394c8c2e39ea327d668f14353b32580e821b1c (patch)
treeb7bd0f40fe31b462d6024ed40defca7369a7487f /lib/cookie.c
parent52d9a11c1c166d248fa09e834cf0171eb07cf23f (diff)
downloadcurl-fa394c8c2e39ea327d668f14353b32580e821b1c.tar.gz
cookie: avoid NULL dereference
... when expiring old cookies. Reported-by: Pavel Gushchin Fixes #2032 Closes #2035
Diffstat (limited to 'lib/cookie.c')
-rw-r--r--lib/cookie.c2
1 files changed, 1 insertions, 1 deletions
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 {