mirror of
https://github.com/curl/curl.git
synced 2026-07-26 02:57:15 +03:00
progress: fix integer overflow check
- Fix logic typo.
Prior to this change the overflow check was reversed, meaning it did
not stop an overflow condition and also if there wasn't an overflow it
erroneously set the total expected transfer size to the maximum value.
Follow-up to 69ce9a7f from earlier today.
Closes https://github.com/curl/curl/pull/17213
This commit is contained in:
parent
b4c8d19c6a
commit
4a70b9823b
1 changed files with 1 additions and 1 deletions
|
|
@ -548,7 +548,7 @@ static void progress_meter(struct Curl_easy *data)
|
|||
((p->flags & PGRS_DL_SIZE_KNOWN) ? p->dl.total_size : p->dl.cur_size);
|
||||
|
||||
/* integer overflow check */
|
||||
if((CURL_OFF_T_MAX - total_expected_size) > dl_size)
|
||||
if((CURL_OFF_T_MAX - total_expected_size) < dl_size)
|
||||
total_expected_size = CURL_OFF_T_MAX; /* capped */
|
||||
else
|
||||
total_expected_size += dl_size;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue