mirror of
https://github.com/curl/curl.git
synced 2026-07-23 12:47:16 +03:00
tool_getparam/set_rate: skip the multiplication on overflow
The code detected the problem but didn't avoid the calculation correctly. Fixes #18624 Reported-by: BobodevMm on github Closes #18625
This commit is contained in:
parent
b0c823b86f
commit
58f071dbe4
1 changed files with 3 additions and 2 deletions
|
|
@ -1012,8 +1012,9 @@ static ParameterError set_rate(const char *nextarg)
|
|||
errorf("too large --rate unit");
|
||||
err = PARAM_NUMBER_TOO_LARGE;
|
||||
}
|
||||
/* this typecast is okay based on the check above */
|
||||
numerator *= (long)numunits;
|
||||
else
|
||||
/* this typecast is okay based on the check above */
|
||||
numerator *= (long)numunits;
|
||||
}
|
||||
|
||||
if(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue