]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Henrik Nordstrom <henrik@henriknordstrom.net>
authorAmos Jeffries <squid3@treenet.co.nz>
Sat, 6 Mar 2010 14:13:09 +0000 (03:13 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sat, 6 Mar 2010 14:13:09 +0000 (03:13 +1300)
Correct quoted-string parser. Got differently broken in digest parser fix.

src/HttpHeaderTools.cc

index 7b754091677fda082c157d23c70d3355995bd84f..6cc35be11350c7f163ac9c77735dc9c2264f21f2 100644 (file)
@@ -342,15 +342,15 @@ httpHeaderParseQuotedString (const char *start, String *val)
     pos = start + 1;
 
     while (*pos != '"') {
-        if (*pos == '\\') {
-            pos++;
-        }
+       bool quoted = (*pos == '\\');
+       if (quoted)
+           pos++;
         if (!*pos) {
             debugs(66, 2, "failed to parse a quoted-string header field near '" << start << "'");
             val->clean();
             return 0;
         }
-        end = pos + strcspn(pos, "\"\\");
+       end = pos + strcspn(pos + quoted, "\"\\") + quoted;
         val->append(pos, end-pos);
         pos = end;
     }