mirror of
https://github.com/curl/curl.git
synced 2026-08-25 20:13:35 +03:00
tool_paramhlp: avoid integer overflow in secs2ms()
The previous approach was wrong and could lead to wrong timeout values getting used. Reported-by: bsr13 on hackerone Closes #17184
This commit is contained in:
parent
cc884c08a8
commit
4db64a6437
3 changed files with 37 additions and 2 deletions
|
|
@ -328,7 +328,7 @@ ParameterError secs2ms(long *valp, const char *str)
|
|||
const unsigned int digs[] = { 1, 10, 100, 1000, 10000, 1000000,
|
||||
1000000, 10000000, 100000000 };
|
||||
if(!str ||
|
||||
curlx_str_number(&str, &secs, CURL_OFF_T_MAX/100))
|
||||
curlx_str_number(&str, &secs, LONG_MAX/1000 - 1))
|
||||
return PARAM_BAD_NUMERIC;
|
||||
if(!curlx_str_single(&str, '.')) {
|
||||
curl_off_t fracs;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue