multi: avoid a theoretical 32-bit wrap

If Curl_uint32_tbl_count() at some future point actually can return
UINT_MAX, this fixes the math to not wrap.

Closes #20742
This commit is contained in:
Daniel Stenberg 2026-02-26 16:58:15 +01:00
parent 9b52d516bb
commit 6789eb0ff9
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -3725,7 +3725,7 @@ CURL **curl_multi_get_handles(CURLM *m)
{
struct Curl_multi *multi = m;
void *entry;
unsigned int count = Curl_uint32_tbl_count(&multi->xfers);
size_t count = Curl_uint32_tbl_count(&multi->xfers);
CURL **a = curlx_malloc(sizeof(struct Curl_easy *) * (count + 1));
if(a) {
unsigned int i = 0;