mirror of
https://github.com/curl/curl.git
synced 2026-08-25 16:23:36 +03:00
multi: cap expire times to INT_MAX internally
When the time-out value is passed to the outside world it needs to fit
in a signed 32-bit variable (on Windows and 32-bit architectures)
anyway. Also, this is 3.5 weeks and we should not knowingly set timeouts
that long anyway.
The previous cap introduced in 3089e7eec8 was only partial.
Closes #22579
This commit is contained in:
parent
e825e55867
commit
a3aaca10d9
1 changed files with 5 additions and 0 deletions
|
|
@ -3757,6 +3757,11 @@ void Curl_expire_ex(struct Curl_easy *data,
|
|||
if(!multi)
|
||||
return;
|
||||
DEBUGASSERT(eid < EXPIRE_LAST);
|
||||
DEBUGASSERT(milli <= INT_MAX);
|
||||
if(milli > INT_MAX)
|
||||
/* Cap ridiculous timeouts, 31-bit ms is still 3.5 weeks. When the time
|
||||
goes to the user, it must fit in this size. */
|
||||
milli = INT_MAX;
|
||||
|
||||
set = *Curl_pgrs_now(data);
|
||||
set.tv_sec += (time_t)(milli / 1000); /* may be a 64 to 32-bit conversion */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue