Commit d9a77730 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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...
parent 2b149168
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -377,8 +377,15 @@ Curl_cookie_add(struct CookieInfo *c,


        free(co);   /* free the newly alloced memory */
        free(co);   /* free the newly alloced memory */
        co = clist; /* point to the previous struct instead */
        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;
    lastc = clist;
    clist = clist->next;
    clist = clist->next;