
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.
30 lines
637 B
PHP
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)
|