Skip to content

Integer overflow in curl_multi_select #15547

Closed
@Lerchensporn

Description

@Lerchensporn

Description

In this code line, the timeout is casted to unsigned long:

error = curl_multi_wait(mh->multi, NULL, 0, (unsigned long) (timeout * 1000.0), &numfds);

But the function expects a signed int, see https://curl.se/libcurl/c/curl_multi_wait.html

In consequence, passing a large timeout to the PHP function curl_multi_select causes undefined behavior according to the C standard. Usually it would it cause 100% CPU usage.

PHP Version

PHP 8.3.10

Operating System

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions