]> 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:28:45 +0000 (22:28 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 1 Jan 2013 05:28:45 +0000 (22:28 -0700)
tools/cachemgr.cc

index b42467caec9b58dc7354128748e5fce372c6a4a7..9b4449c59b3ec6460101d2ad203d1c986384e3b2 100644 (file)
@@ -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;
     }