1 |
|
2 |
https://bugzilla.redhat.com/show_bug.cgi?id=895972 |
3 |
http://bazaar.launchpad.net/~squid/squid/3.1/revision/10483 |
4 |
http://bazaar.launchpad.net/~squid/squid/3.1/revision/10484 |
5 |
|
6 |
--- tools/cachemgr.cc 2013-01-23 16:59:31.673774717 +0100 |
7 |
+++ tools/cachemgr.cc.oden 2013-01-23 17:00:11.335776722 +0100 |
8 |
@@ -943,10 +943,10 @@ read_post_request(void) |
9 |
|
10 |
// limit the input to something reasonable. |
11 |
// 4KB should be enough for the GET/POST data length, but may be extended. |
12 |
- size_t bufLen = (len >= 4096 ? len : 4095); |
13 |
+ size_t bufLen = (len < 4096 ? len : 4095); |
14 |
char *buf = (char *)xmalloc(bufLen + 1); |
15 |
|
16 |
- size_t readLen = fread(buf, bufLen, 1, stdin); |
17 |
+ size_t readLen = fread(buf, 1, bufLen, stdin); |
18 |
if (readLen == 0) { |
19 |
xfree(buf); |
20 |
return NULL; |
21 |
@@ -955,9 +955,9 @@ read_post_request(void) |
22 |
len -= readLen; |
23 |
|
24 |
// purge the remainder of the request entity |
25 |
- while (len > 0) { |
26 |
+ while (len > 0 && readLen) { |
27 |
char temp[65535]; |
28 |
- readLen = fread(temp, 65535, 1, stdin); |
29 |
+ readLen = fread(temp, 1, 65535, stdin); |
30 |
len -= readLen; |
31 |
} |
32 |
|