From: Henrik Nordstrom Date: Sat, 6 Mar 2010 13:17:08 +0000 (+0100) Subject: Correct quoted-string parser. Got differently broken in digest parser fix. X-Git-Tag: SQUID_3_2_0_1~382 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b1596fd16c8b1213c7a7865c376a97ae00e60f1f;p=thirdparty%2Fsquid.git Correct quoted-string parser. Got differently broken in digest parser fix. --- diff --git a/src/HttpHeaderTools.cc b/src/HttpHeaderTools.cc index d99fba12bb..2924e85817 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; }