Files
php-src/ext/curl/tests/gh15547.phpt
Christoph M. Becker bb6dbdcf94 Fix curl_multi_exec() overflow message (GH-17078)
As is, passing `2147484` as `$timeout`, throws a `ValueError` stating
the `$timeout` needs to be between 0 and 2147484, what is a confusing.
Thus we report the proper threshold as float.

While we're at it we also drop the superfluous `(double)` cast, and
rely on C's usual arithmetic conversions.
2024-12-13 16:06:39 +01:00

30 lines
637 B
PHP

--TEST--
GH-15547 - curl_multi_select overflow on timeout argument
--EXTENSIONS--
curl
--FILE--
<?php
$mh = curl_multi_init();
try {
curl_multi_select($mh, -2500000);
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
}
curl_multi_close($mh);
$mh = curl_multi_init();
try {
curl_multi_select($mh, 2500000);
} catch (\ValueError $e) {
echo $e->getMessage() . PHP_EOL;
}
curl_multi_close($mh);
$mh = curl_multi_init();
var_dump(curl_multi_select($mh, 1000000));
?>
--EXPECTF--
curl_multi_select(): Argument #2 ($timeout) must be between %d and %f
curl_multi_select(): Argument #2 ($timeout) must be between %d and %f
int(0)