From: Amos Jeffries Date: Tue, 1 Jan 2013 05:28:12 +0000 (-0700) Subject: Additional pieces of SQUID-2012:1 X-Git-Tag: SQUID_3_4_0_1~401 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4877287e085d8328e1416c96f403b26411c2e77;p=thirdparty%2Fsquid.git Additional pieces of SQUID-2012:1 --- diff --git a/tools/cachemgr.cc b/tools/cachemgr.cc index de28e1ee95..4c998d2d9f 100644 --- a/tools/cachemgr.cc +++ b/tools/cachemgr.cc @@ -978,10 +978,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; @@ -992,7 +992,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; }