mirror of
https://github.com/curl/curl.git
synced 2026-04-15 01:21:44 +03:00
multi: fix add_handle resizing
Due to someone being stupid, the resizing of the multi's transfer table was actually shrinking it. Oh my. Add test751 to reproduce, add code assertion. Fixes #17473 Reported-by: Jeroen Ooms Closes #17475
This commit is contained in:
parent
698491f444
commit
d16ccbd55d
5 changed files with 132 additions and 2 deletions
|
|
@ -347,7 +347,8 @@ static CURLMcode multi_xfers_add(struct Curl_multi *multi,
|
|||
if(unused <= min_unused) {
|
||||
/* make it a 64 multiple, since our bitsets frow by that and
|
||||
* small (easy_multi) grows to at least 64 on first resize. */
|
||||
unsigned int newsize = ((capacity + min_unused) + 63) / 64;
|
||||
unsigned int newsize = (((capacity + min_unused) + 63) / 64) * 64;
|
||||
DEBUGASSERT(newsize > capacity);
|
||||
/* Grow the bitsets first. Should one fail, we do not need
|
||||
* to downsize the already resized ones. The sets continue
|
||||
* to work properly when larger than the table, but not
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue