aboutsummaryrefslogtreecommitdiff
path: root/lib/cookie.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cookie.c')
-rw-r--r--lib/cookie.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/cookie.c b/lib/cookie.c
index d1c308304..3c4034c42 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -233,8 +233,18 @@ Curl_cookie_add(struct CookieInfo *c,
/* what _is_ this field for? */
break;
case 2:
- co->path = strdup(ptr);
- break;
+ /* It turns out, that sometimes the file format allows the path
+ field to remain not filled in, we try to detect this and work
+ around it! Andrés García made us aware of this... */
+ if (strcmp("TRUE", ptr) && strcmp("FALSE", ptr)) {
+ /* only if the path doesn't look like a boolean option! */
+ co->path = strdup(ptr);
+ break;
+ }
+ /* this doesn't look like a path, make one up! */
+ co->path = strdup("/");
+ fields++; /* add a field and fall down to secure */
+ /* FALLTHROUGH */
case 3:
co->secure = strequal(ptr, "TRUE");
break;