mirror of
https://github.com/rkd77/elinks.git
synced 2024-09-12 00:34:47 -04:00
http chunked: Better check for overflow.
This commit is contained in:
parent
a4140594f1
commit
446eec0bd3
@ -1224,13 +1224,11 @@ read_chunked_http_data(struct connection *conn, struct read_buffer *rb)
|
|||||||
if (zero) http->chunk_remaining = 0;
|
if (zero) http->chunk_remaining = 0;
|
||||||
len = http->chunk_remaining;
|
len = http->chunk_remaining;
|
||||||
|
|
||||||
if (http->chunk_remaining) {
|
if (http->chunk_remaining > INT_MAX)
|
||||||
/* Maybe everything necessary didn't come yet..
|
int_lower_bound(&len, rb->length);
|
||||||
* This handle unlikely case when len < 0
|
/* Maybe everything necessary didn't come yet.. */
|
||||||
* or http->chunk_remaining > 4GB and len == 0 */
|
int_upper_bound(&len, rb->length);
|
||||||
int_bounds(&len, 1, rb->length);
|
conn->received += len;
|
||||||
conn->received += len;
|
|
||||||
}
|
|
||||||
|
|
||||||
data = decompress_data(conn, rb->data, len, &data_len);
|
data = decompress_data(conn, rb->data, len, &data_len);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user