]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Abort Host header lookup if line ends without an LF.
authorAmos Jeffries <squid3@treenet.co.nz>
Thu, 5 Mar 2015 10:19:47 +0000 (02:19 -0800)
committerAmos Jeffries <squid3@treenet.co.nz>
Thu, 5 Mar 2015 10:19:47 +0000 (02:19 -0800)
 Detected by Coverity Scan. Issue 1270007

src/http/one/Parser.cc

index 7d74f9dd2181b815f47ab1e6ada5d019f07b9131..a3c199bbda3472e1b521f2b426ce53b2cddc83f1 100644 (file)
@@ -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))