From: Daniel Stenberg Date: Mon, 7 Jan 2002 14:56:15 +0000 (+0000) Subject: added precautions to not go insane when two matching cookies end up in the X-Git-Tag: curl-7_9_3-pre1~16 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9a77730114b25f0d073208495c8702d9dc28161;p=thirdparty%2Fcurl.git added precautions to not go insane when two matching cookies end up in the cookie list, even though they're not supposed to do that... --- diff --git a/lib/cookie.c b/lib/cookie.c index 697081117d..9ffdd2abe3 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -377,8 +377,15 @@ Curl_cookie_add(struct CookieInfo *c, free(co); /* free the newly alloced memory */ co = clist; /* point to the previous struct instead */ - } + /* We have replaced a cookie, now skip the rest of the list but + make sure the 'lastc' pointer is properly set */ + do { + lastc = clist; + clist = clist->next; + } while(clist); + break; + } } lastc = clist; clist = clist->next;