From: Egor Ignatov Date: Fri, 15 Sep 2023 09:50:16 +0000 (+0000) Subject: Improve handling of empty lines received prior to request-line (#1470) X-Git-Tag: SQUID_7_0_1~355 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7faf8e8c4e0752ec4c05269451b8a2245fda0ccc;p=thirdparty%2Fsquid.git Improve handling of empty lines received prior to request-line (#1470) --- diff --git a/src/http/one/RequestParser.cc b/src/http/one/RequestParser.cc index a19d68f2ac..8dcd1e7eac 100644 --- a/src/http/one/RequestParser.cc +++ b/src/http/one/RequestParser.cc @@ -44,7 +44,8 @@ Http::One::RequestParser::skipGarbageLines() "Ignored due to relaxed_header_parser."); // Be tolerant of prefix empty lines // ie any series of either \n or \r\n with no other characters and no repeated \r - while (!buf_.isEmpty() && (buf_[0] == '\n' || (buf_[0] == '\r' && buf_[1] == '\n'))) { + while (!buf_.isEmpty() && (buf_[0] == '\n' || + (buf_[0] == '\r' && buf_.length() > 1 && buf_[1] == '\n'))) { buf_.consume(1); } }