From: Willy Tarreau Date: Fri, 24 Feb 2012 18:20:12 +0000 (+0100) Subject: MEDIUM: increase chunk-size limit to 2GB-1 X-Git-Tag: v1.5-dev8~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=431946e9617572d2813bd5a8f5a51ce36f841ea3;p=thirdparty%2Fhaproxy.git MEDIUM: increase chunk-size limit to 2GB-1 Since commit 115acb97, chunk size was limited to 256MB. There is no reason for such a limit and the comment on the code suggests a missing zero. However, increasing the limit past 2 GB causes trouble due to some 32-bit subtracts in various computations becoming negative (eg: buffer_max_len). So let's limit the chunk size to 2 GB - 1 max. --- diff --git a/src/proto_http.c b/src/proto_http.c index cfbebd9f73..5efc7ec751 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -2150,7 +2150,7 @@ int http_parse_chunk_size(struct buffer *buf, struct http_msg *msg) break; if (++ptr >= end) ptr = buf->data; - if (chunk & 0xF000000) /* overflow will occur */ + if (chunk & 0xF8000000) /* integer overflow will occur if result >= 2GB */ goto error; chunk = (chunk << 4) + c; }