From: Xinchen Hui Date: Sat, 27 Apr 2013 15:41:31 +0000 (+0800) Subject: Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB pointer... X-Git-Tag: php-5.5.0RC1~32^2~17^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8f5a534b215905790a4dd5465804c1fbc21468c4;p=php Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB pointer has closed) --- diff --git a/NEWS b/NEWS index 59871310c7..3d37baf5b1 100644 --- 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) diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index a4c1b874fd..45e39d0b45 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -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; diff --git a/ext/mysqli/tests/bug64726.phpt b/ext/mysqli/tests/bug64726.phpt index 3e43916d35..1f9bbaa93e 100644 --- a/ext/mysqli/tests/bug64726.phpt +++ b/ext/mysqli/tests/bug64726.phpt @@ -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--