diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/cookie.c | 8 | 
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/cookie.c b/lib/cookie.c index 5eb3c1209..29f627fd4 100644 --- a/lib/cookie.c +++ b/lib/cookie.c @@ -528,10 +528,16 @@ Curl_cookie_add(struct Curl_easy *data,          while(*whatptr && ISBLANK(*whatptr))            whatptr++; -        if(!co->name && sep) { +        if(!co->name) {            /* The very first name/value pair is the actual cookie name */ +          if(!sep) { +            /* Bad name/value pair. */ +            badcookie = TRUE; +            break; +          }            co->name = strdup(name);            co->value = strdup(whatptr); +          done = TRUE;            if(!co->name || !co->value) {              badcookie = TRUE;              break;  | 
