From 2d40b13fcd667e4b3f4d1d57534a457b4d7910f9 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Thu, 5 Mar 2015 02:19:47 -0800 Subject: [PATCH] Abort Host header lookup if line ends without an LF. Detected by Coverity Scan. Issue 1270007 --- src/http/one/Parser.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)) -- 2.47.2