From: Amos Jeffries Date: Tue, 1 Jan 2013 05:29:43 +0000 (-0700) Subject: Additional pieces of SQUID-2012:1 X-Git-Tag: SQUID_3_1_23~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0de9562463b517a798f8c84d323d9c298b6c4737;p=thirdparty%2Fsquid.git Additional pieces of SQUID-2012:1 --- diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index 7895fa5e68..7a9d0496e2 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -943,10 +943,10 @@ read_post_request(void) // limit the input to something reasonable. // 4KB should be enough for the GET/POST data length, but may be extended. - size_t bufLen = (len >= 4096 ? len : 4095); + size_t bufLen = (len < 4096 ? len : 4095); char *buf = (char *)xmalloc(bufLen + 1); - size_t readLen = fread(buf, bufLen, 1, stdin); + size_t readLen = fread(buf, 1, bufLen, stdin); if (readLen == 0) { xfree(buf); return NULL; @@ -957,7 +957,7 @@ read_post_request(void) // purge the remainder of the request entity while (len > 0) { char temp[65535]; - readLen = fread(temp, 65535, 1, stdin); + readLen = fread(temp, 1, 65535, stdin); len -= readLen; }