lib: fix two curlx_strtoofft invokes

- cf-h1-proxy: check return code and return error if the parser fails

- http: make the Retry-After parser check for a date string first then
  number to avoid mis-parsing the begining of a date as a number

Closes #16548
This commit is contained in:
Daniel Stenberg 2025-03-03 22:40:43 +01:00
parent 9213e4e497
commit 18c6d5512f
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 17 additions and 10 deletions

View file

@ -315,8 +315,11 @@ static CURLcode on_resp_header(struct Curl_cfilter *cf,
k->httpcode);
}
else {
(void)curlx_strtoofft(header + strlen("Content-Length:"),
NULL, 10, &ts->cl);
if(curlx_strtoofft(header + strlen("Content-Length:"),
NULL, 10, &ts->cl)) {
failf(data, "Unsupported Content-Length value");
return CURLE_WEIRD_SERVER_REPLY;
}
}
}
else if(Curl_compareheader(header,