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

index 21fc0ee8451806383b2cbe64b3f9be11398ea60c..a53f3f0e98caf9b135d740462f9fc28a4cc3c7f8 100644 (file)
@@ -980,10 +980,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;
@@ -994,7 +994,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;
     }