summaryrefslogtreecommitdiff
path: root/lib/http_chunks.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-02-12 14:33:17 +0100
committerDaniel Stenberg <daniel@haxx.se>2014-02-12 14:35:46 +0100
commit0ab97ba0090f2609760c33000181f08757336a48 (patch)
treeb2b818a5f5c6bccf9d1cdff14a0fb5f93ff85f84 /lib/http_chunks.c
parentbff739894260238c1292bb43e1eb643b481368ae (diff)
downloadcurl-0ab97ba0090f2609760c33000181f08757336a48.tar.gz
chunked decoder: track overflows correctly
The code didn't properly check the return codes to detect overflows so it could trigger incorrectly. Like on mingw32. Regression introduced in 345891edba (curl 7.35.0) Bug: http://curl.haxx.se/mail/lib-2014-02/0097.html Reported-by: LM
Diffstat (limited to 'lib/http_chunks.c')
-rw-r--r--lib/http_chunks.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/http_chunks.c b/lib/http_chunks.c
index 47de95845..83e3f0eec 100644
--- a/lib/http_chunks.c
+++ b/lib/http_chunks.c
@@ -162,8 +162,8 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
}
ch->datasize=curlx_strtoofft(ch->hexbuffer, &endptr, 16);
- if(errno == ERANGE)
- /* over or underflow is an error */
+ if((ch->datasize == CURL_OFF_T_MAX) && (errno == ERANGE))
+ /* overflow is an error */
return CHUNKE_ILLEGAL_HEX;
ch->state = CHUNK_LF; /* now wait for the CRLF */
}