- Imap:
. Fixed Bug #63126 DISABLE_AUTHENTICATOR ignores array (Remi)
+- MySQLnd:
+ . Fixed bug #63398 (Segfault when polling closed link). (Laruence)
+
- Reflection:
. Fixed Bug #63614 (Fatal error on Reflection). (Laruence)
MYSQLND **p = in_array;
HashTable *new_hash;
zval **elem, **dest_elem;
- int ret = 0;
+ int ret = 0, i = 0;
ALLOC_HASHTABLE(new_hash);
zend_hash_init(new_hash, zend_hash_num_elements(Z_ARRVAL_P(out_array)), NULL, ZVAL_PTR_DTOR, 0);
zend_hash_get_current_data(Z_ARRVAL_P(out_array), (void **) &elem) == SUCCESS;
zend_hash_move_forward(Z_ARRVAL_P(out_array)))
{
+ i++;
if (Z_TYPE_PP(elem) != IS_OBJECT || !instanceof_function(Z_OBJCE_PP(elem), mysqli_link_class_entry TSRMLS_CC)) {
continue;
}
{
MY_MYSQL *mysql;
+ MYSQLI_RESOURCE *my_res;
mysqli_object *intern = (mysqli_object *)zend_object_store_get_object(*elem TSRMLS_CC);
- mysql = (MY_MYSQL *) ((MYSQLI_RESOURCE *)intern->ptr)->ptr;
+ if (!(my_res = (MYSQLI_RESOURCE *)intern->ptr)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "[%d] Couldn't fetch %s", i, intern->zo.ce->name);
+ continue;
+ }
+ mysql = (MY_MYSQL *) my_res->ptr;
if (mysql->mysql == *p) {
zend_hash_next_index_insert(new_hash, (void *)elem, sizeof(zval *), (void **)&dest_elem);
if (dest_elem) {
--- /dev/null
+--TEST--\r
+Bug #63398 (Segfault when polling closed link)\r
+--SKIPIF--\r
+<?php\r
+require_once('skipif.inc');\r
+require_once("connect.inc");\r
+if (!$IS_MYSQLND) {\r
+ die("skip mysqlnd only test");\r
+}\r
+?>\r
+--FILE--\r
+<?php\r
+$link = new mysqli('localhost', 'test', NULL, 'test');\r
+\r
+mysqli_close($link);\r
+\r
+$read = $error = $reject = array();\r
+$read[] = $error[] = $reject[] = $link;\r
+\r
+mysqli_poll($read, $error, $reject, 1);\r
+\r
+echo "okey";\r
+?>\r
+--EXPECTF--\r
+Warning: mysqli_poll(): [1] Couldn't fetch mysqli in %sbug63398.php on line %d\r
+\r
+Warning: mysqli_poll(): [1] Couldn't fetch mysqli in %sbug63398.php on line %d\r
+\r
+Warning: mysqli_poll(): No stream arrays were passed in %sbug63398.php on line %d\r
+\r
+Warning: mysqli_poll(): [1] Couldn't fetch mysqli in %sbug63398.php on line %d\r
+\r
+Warning: mysqli_poll(): [1] Couldn't fetch mysqli in %sbug63398.php on line %d\r
+okey\r