mirror of
https://github.com/curl/curl.git
synced 2026-07-25 16:27:16 +03:00
strtoofft: after space, there cannot be a control code
With the change from ISSPACE() to ISBLANK() this function no longer
deals with (ignores) control codes the same way, which could lead to
this function returning unexpected values like in the case of
"Content-Length: \r-12354".
Follow-up to 6f9fb7ec2d
Detected by OSS-fuzz
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=51140
Assisted-by: Max Dymond
Closes #9458
This commit is contained in:
parent
9c9e83931e
commit
279f638b74
1 changed files with 1 additions and 1 deletions
|
|
@ -224,7 +224,7 @@ CURLofft curlx_strtoofft(const char *str, char **endp, int base,
|
|||
|
||||
while(*str && ISBLANK(*str))
|
||||
str++;
|
||||
if('-' == *str) {
|
||||
if(('-' == *str) || (ISSPACE(*str))) {
|
||||
if(endp)
|
||||
*endp = (char *)str; /* didn't actually move */
|
||||
return CURL_OFFT_INVAL; /* nothing parsed */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue