]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Additional pieces of SQUID-2012:1
authorAmos Jeffries <squid3@treenet.co.nz>
Tue, 1 Jan 2013 05:29:43 +0000 (22:29 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 1 Jan 2013 05:29:43 +0000 (22:29 -0700)
tools/cachemgr.cc

index 7895fa5e68055646e613591fd7854210ce121509..7a9d0496e2d26c83628099872480072a3797eb24 100644 (file)
@@ -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;
     }