]> sjero.net Git - wget/commitdiff
Maintain the cookie value quoted if it was in the server response.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 2 Aug 2011 20:58:38 +0000 (22:58 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Tue, 2 Aug 2011 20:58:38 +0000 (22:58 +0200)
src/ChangeLog
src/cookies.c

index bc766eb2f139a092abfeb42e964c32533d74e4a5..bd10d2f1e9031d7d5c5dd26dd39c73e3b13a24db 100644 (file)
@@ -1,3 +1,9 @@
+2011-08-02  Giuseppe Scrivano  <giuseppe@southpole.se>
+
+       * cookies.c (parse_set_cookie): If the value is quoted, do not modify
+       it.
+       Reported by: Nirgal Vourgère <jmv_deb@nirgal.com>
+
 2011-07-29  Giuseppe Scrivano  <giuseppe@southpole.se>
 
        * log.c (logprintf): Exit immediately on a SIGPIPE error.
index 2e41688632d77455af8abd18990aacbfe1826c89..7c3fb1cbab9708b7a20e45b449edf7528fc28983 100644 (file)
@@ -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);