From: Giuseppe Scrivano Date: Tue, 2 Aug 2011 20:58:38 +0000 (+0200) Subject: Maintain the cookie value quoted if it was in the server response. X-Git-Tag: v1.13~10 X-Git-Url: http://sjero.net/git/?p=wget;a=commitdiff_plain;h=473ec526d29b0b040d2edd07f0a40227f4695be7 Maintain the cookie value quoted if it was in the server response. --- diff --git a/src/ChangeLog b/src/ChangeLog index bc766eb2..bd10d2f1 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-08-02 Giuseppe Scrivano + + * cookies.c (parse_set_cookie): If the value is quoted, do not modify + it. + Reported by: Nirgal Vourgère + 2011-07-29 Giuseppe Scrivano * log.c (logprintf): Exit immediately on a SIGPIPE error. diff --git a/src/cookies.c b/src/cookies.c index 2e416886..7c3fb1cb 100644 --- a/src/cookies.c +++ b/src/cookies.c @@ -350,6 +350,13 @@ parse_set_cookie (const char *set_cookie, bool silent) goto error; if (!value.b) goto error; + + /* If the value is quoted, do not modify it. */ + if (*(value.b - 1) == '"') + value.b--; + if (*value.e == '"') + value.e++; + cookie->attr = strdupdelim (name.b, name.e); cookie->value = strdupdelim (value.b, value.e);