From 4949b58d0c210cd8b2474b6394b92c7d3d84e8e5 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sun, 7 Mar 2010 03:13:09 +1300 Subject: [PATCH] Author: Henrik Nordstrom Correct quoted-string parser. Got differently broken in digest parser fix. --- src/HttpHeaderTools.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } -- 2.47.3