]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Correct quoted-string parser. Got differently broken in digest parser fix.
authorHenrik Nordstrom <henrik@henriknordstrom.net>
Sat, 6 Mar 2010 13:17:08 +0000 (14:17 +0100)
committerHenrik Nordstrom <henrik@henriknordstrom.net>
Sat, 6 Mar 2010 13:17:08 +0000 (14:17 +0100)
src/HttpHeaderTools.cc

index d99fba12bb3c39a8f8d571eab86345358d40e2ca..2924e858171f1ae1e161b24858a16588fa7461cf 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;
     }