com php-src: Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB pointer h as closed): NEWS ext/mysqli/mysqli.c ext/mysqli/t
ests/bug64726.phpt
| From: | Xinchen Hui | Date: | Sat, 27 Apr 2013 15:41:31 +0000 |
| Subject: | com php-src: Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB pointer h as closed): NEWS ext/mysqli/mysqli.c ext/mysqli/t ests/bug64726.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-72050@lists.php.net to get a copy of this message | ||
Commit: 8f5a534b215905790a4dd5465804c1fbc21468c4
Author: Xinchen Hui <laruence@php.net> Sat, 27 Apr 2013 23:41:31 +0800
Parents: d54432ed98e1ba563677d40f32f5bb10124478af
Branches: PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8f5a534b215905790a4dd5465804c1fbc21468c4
Log:
Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB pointer has closed)
Bugs:
https://bugs.php.net/64726
Changed paths:
M NEWS
M ext/mysqli/mysqli.c
M ext/mysqli/tests/bug64726.phpt
Diff:
diff --git a/NEWS b/NEWS
index 5987131..3d37baf 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 a4c1b87..45e39d0 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 3e43916..1f9bbaa 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--
<?php
require_once('skipif.inc');