From: Amos Jeffries Date: Fri, 11 Feb 2011 20:19:28 +0000 (-0700) Subject: Handle HTCP read failures and small packets. X-Git-Tag: SQUID_3_1_12~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=713c85a72d3f1dd11b33e05657504aa4e5a67848;p=thirdparty%2Fsquid.git Handle HTCP read failures and small packets. --- diff --git a/src/htcp.cc b/src/htcp.cc index 93ff7e9338..4d164d1230 100644 --- a/src/htcp.cc +++ b/src/htcp.cc @@ -1347,10 +1347,10 @@ htcpHandleMsg(char *buf, int sz, IpAddress &from) htcpDataHeader hdr; char *hbuf; int hsz; - assert (sz >= 0); - if ((size_t)sz < sizeof(htcpHeader)) { - debugs(31, 3, "htcpHandle: msg size less than htcpHeader size"); + if (sz < 0 || (size_t)sz < sizeof(htcpHeader)) { + // These are highly likely to be attack packets. Should probably get a bigger warning. + debugs(31, 2, "htcpHandle: msg size less than htcpHeader size from " << from); return; }