diff options
author | Xinchen Hui <laruence@php.net> | 2012-08-22 13:49:04 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2012-08-22 13:49:04 +0800 |
commit | 4e561055a46fc68077300b8ec25490a198e82560 (patch) | |
tree | d0233c8f9b895083567f6141a91132636081c37d | |
parent | b0dbf714666516ac191bcc5f31498352ffbcb13c (diff) | |
parent | e5bdd2c0eeab50dc1f863dae9a32d3857ece6a79 (diff) | |
download | php-git-4e561055a46fc68077300b8ec25490a198e82560.tar.gz |
Merge branch 'PHP-5.3' into PHP-5.4
-rw-r--r-- | ext/mysqli/mysqli_nonapi.c | 5 | ||||
-rw-r--r-- | ext/mysqli/tests/bug62885.phpt | 26 |
2 files changed, 31 insertions, 0 deletions
diff --git a/ext/mysqli/mysqli_nonapi.c b/ext/mysqli/mysqli_nonapi.c index 0cc1240208..7e1b9355d0 100644 --- a/ext/mysqli/mysqli_nonapi.c +++ b/ext/mysqli/mysqli_nonapi.c @@ -781,6 +781,11 @@ PHP_FUNCTION(mysqli_poll) RETURN_FALSE; } + if (!r_array && !e_array) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "No stream arrays were passed"); + RETURN_FALSE; + } + if (r_array != NULL) { mysqlnd_zval_array_to_mysqlnd_array(r_array, &new_r_array TSRMLS_CC); } diff --git a/ext/mysqli/tests/bug62885.phpt b/ext/mysqli/tests/bug62885.phpt new file mode 100644 index 0000000000..9fb0aa0f03 --- /dev/null +++ b/ext/mysqli/tests/bug62885.phpt @@ -0,0 +1,26 @@ +--TEST--
+Bug #62885 (mysqli_poll - Segmentation fault)
+--SKIPIF--
+<?php
+require_once('skipif.inc');
+require_once("connect.inc");
+if (!$IS_MYSQLND) {
+ die("skip mysqlnd only test");
+}
+?>
+--FILE--
+<?php
+error_reporting(E_ALL);
+$tablica = array();
+$test1 = mysqli_poll($test2, $test3, $tablica, null);
+
+$test2 = array();
+$test2 = array();
+$test1 = mysqli_poll($test2, $test3, $tablica, null);
+echo "okey";
+?>
+--EXPECTF--
+Warning: mysqli_poll(): No stream arrays were passed in %sbug62885.php on line %d
+
+Warning: mysqli_poll(): No stream arrays were passed in %sbug62885.php on line %d
+okey
|