mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Merge branch 'PHP-8.3'
This commit is contained in:
commit
f7186a06e5
4
NEWS
4
NEWS
@ -22,6 +22,10 @@ PHP NEWS
|
||||
. Fixed bug GH-13773 (DatePeriod not taking into account microseconds for end
|
||||
date). (Mark Bennewitz, Derick)
|
||||
|
||||
- Curl:
|
||||
. FIxed bug GH-15547 (curl_multi_select overflow on timeout argument).
|
||||
(David Carlier)
|
||||
|
||||
- DOM:
|
||||
. Fixed bug GH-15551 (Segmentation fault (access null pointer) in
|
||||
ext/dom/xml_common.h). (nielsdos)
|
||||
|
@ -187,7 +187,15 @@ PHP_FUNCTION(curl_multi_select)
|
||||
|
||||
mh = Z_CURL_MULTI_P(z_mh);
|
||||
|
||||
error = curl_multi_wait(mh->multi, NULL, 0, (unsigned long) (timeout * 1000.0), &numfds);
|
||||
if (!(timeout >= 0.0 && timeout <= ((double)INT_MAX / 1000.0))) {
|
||||
php_error_docref(NULL, E_WARNING, "timeout must be between 0 and %d", (int)ceilf((double)INT_MAX / 1000));
|
||||
#ifdef CURLM_BAD_FUNCTION_ARGUMENT
|
||||
SAVE_CURLM_ERROR(mh, CURLM_BAD_FUNCTION_ARGUMENT);
|
||||
#endif
|
||||
RETURN_LONG(-1);
|
||||
}
|
||||
|
||||
error = curl_multi_wait(mh->multi, NULL, 0, (int) (timeout * 1000.0), &numfds);
|
||||
if (CURLM_OK != error) {
|
||||
SAVE_CURLM_ERROR(mh, error);
|
||||
RETURN_LONG(-1);
|
||||
|
29
ext/curl/tests/gh15547.phpt
Normal file
29
ext/curl/tests/gh15547.phpt
Normal file
@ -0,0 +1,29 @@
|
||||
--TEST--
|
||||
GH-15547 - curl_multi_select overflow on timeout argument
|
||||
--EXTENSIONS--
|
||||
curl
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$mh = curl_multi_init();
|
||||
var_dump(curl_multi_select($mh, -2500000));
|
||||
var_dump(curl_multi_strerror(curl_multi_errno($mh)));
|
||||
curl_multi_close($mh);
|
||||
$mh = curl_multi_init();
|
||||
var_dump(curl_multi_select($mh, 2500000));
|
||||
var_dump(curl_multi_strerror(curl_multi_errno($mh)));
|
||||
curl_multi_close($mh);
|
||||
$mh = curl_multi_init();
|
||||
var_dump(curl_multi_select($mh, 1000000));
|
||||
var_dump(curl_multi_strerror(curl_multi_errno($mh)));
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: curl_multi_select(): timeout must be between 0 and %d in %s on line %d
|
||||
int(-1)
|
||||
%s
|
||||
|
||||
Warning: curl_multi_select(): timeout must be between 0 and %d in %s on line %d
|
||||
int(-1)
|
||||
%s
|
||||
int(0)
|
||||
string(8) "No error"
|
Loading…
Reference in New Issue
Block a user