From: Amos Jeffries Date: Sat, 6 Mar 2010 14:13:09 +0000 (+1300) Subject: Author: Henrik Nordstrom X-Git-Tag: SQUID_3_1_0_18~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4949b58d0c210cd8b2474b6394b92c7d3d84e8e5;p=thirdparty%2Fsquid.git Author: Henrik Nordstrom Correct quoted-string parser. Got differently broken in digest parser fix. --- diff --git a/src/HttpHeaderTools.cc b/src/HttpHeaderTools.cc index 7b75409167..6cc35be113 100644 --- a/src/HttpHeaderTools.cc +++ b/src/HttpHeaderTools.cc @@ -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; }