From: Amos Jeffries Date: Thu, 5 Mar 2015 10:19:47 +0000 (-0800) Subject: Abort Host header lookup if line ends without an LF. X-Git-Tag: merge-candidate-3-v1~226 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d40b13fcd667e4b3f4d1d57534a457b4d7910f9;p=thirdparty%2Fsquid.git Abort Host header lookup if line ends without an LF. Detected by Coverity Scan. Issue 1270007 --- diff --git a/src/http/one/Parser.cc b/src/http/one/Parser.cc index 7d74f9dd21..a3c199bbda 100644 --- a/src/http/one/Parser.cc +++ b/src/http/one/Parser.cc @@ -107,7 +107,8 @@ Http::One::Parser::getHeaderField(const char *name) static const SBuf crlf("\r\n"); while (tok.prefix(p, iso8859Line)) { - tok.skipOne(CharacterSet::LF); // move tokenizer past the LF + if (!tok.skipOne(CharacterSet::LF)) // move tokenizer past the LF + break; // error. reached invalid octet or end of buffer insted of an LF ?? // header lines must start with the name (case insensitive) if (p.substr(0, namelen).caseCmp(name, namelen))