]> granicus.if.org Git - php/commitdiff
Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB pointer...
authorXinchen Hui <laruence@php.net>
Sat, 27 Apr 2013 15:41:31 +0000 (23:41 +0800)
committerXinchen Hui <laruence@php.net>
Sat, 27 Apr 2013 15:41:31 +0000 (23:41 +0800)
NEWS
ext/mysqli/mysqli.c
ext/mysqli/tests/bug64726.phpt

diff --git a/NEWS b/NEWS
index 59871310c7e06e92650fb758b3de9cc49fa734cb..3d37baf5b155ead061561f56eab833bf55d7939f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,10 @@ PHP                                                                        NEWS
 - Fileinfo:
   . Upgraded libmagic to 5.14. (Anatol)
 
+- MySQLi:
+  . Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB
+    pointer has closed). (Laruence)
+
 - Zip:
   . Fixed bug #64342 (ZipArchive::addFile() has to check for file existence).
     (Anatol)
index a4c1b874fdcb46b756e533af8bc45738b186977e..45e39d0b45b9922c25c1bac0ef6759fcfffad703 100644 (file)
@@ -1257,7 +1257,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
 
        php_mysqli_fetch_into_hash_aux(return_value, result, fetchtype TSRMLS_CC);
 
-       if (into_object && Z_TYPE_P(return_value) != IS_NULL) {
+       if (into_object && Z_TYPE_P(return_value) == IS_ARRAY) {
                zval dataset = *return_value;
                zend_fcall_info fci;
                zend_fcall_info_cache fcc;
index 3e43916d35b2fe566083c5e892d51a1722bd2485..1f9bbaa93ec627d0f1d7bcf7d172d8ba25e2846c 100644 (file)
@@ -1,5 +1,5 @@
 --TEST--
-Bug #63398 (Memleak when calling fetch_object on a use_result and DB pointer has closed)
+Bug #63398 (Segfault when calling fetch_object on a use_result and DB pointer has closed)
 --SKIPIF--
 <?php
 require_once('skipif.inc');