From: rousskov <> Date: Tue, 22 May 2007 22:37:26 +0000 (+0000) Subject: Bug #1967 fix: avoid new strncmp() that silently converts char* buffers into X-Git-Tag: SQUID_3_0_PRE7~244 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d54056b61f47de24940851cb00de8054bc280234;p=thirdparty%2Fsquid.git Bug #1967 fix: avoid new strncmp() that silently converts char* buffers into Strings because String length is limited by 64KB and because it is an expensive conversion. All similar conversions should be removed, but that is bug #1970. --- diff --git a/src/HttpReply.cc b/src/HttpReply.cc index 3f847d1dc2..04acd852db 100644 --- a/src/HttpReply.cc +++ b/src/HttpReply.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.cc,v 1.93 2007/05/18 06:41:22 amosjeffries Exp $ + * $Id: HttpReply.cc,v 1.94 2007/05/22 16:37:26 rousskov Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov @@ -433,7 +433,7 @@ HttpReply::bodySize(method_t method) const bool HttpReply::sanityCheckStartLine(MemBuf *buf, http_status *error) { - if (buf->contentSize() >= protoPrefix.size() && strncmp(protoPrefix, buf->content(), protoPrefix.size()) != 0) { + if (buf->contentSize() >= protoPrefix.size() && protoPrefix.compare(buf->content(), protoPrefix.size()) != 0) { debugs(58, 3, "HttpReply::sanityCheckStartLine: missing protocol prefix (" << protoPrefix << ") in '" << buf->content() << "'"); *error = HTTP_INVALID_HEADER; return false;