mirror of
https://github.com/curl/curl.git
synced 2026-08-03 10:00:30 +03:00
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
This commit is contained in:
parent
bff7398942
commit
0ab97ba009
1 changed files with 2 additions and 2 deletions
|
|
@ -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 */
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue