com php-src: Also fixed bug #64726 in 5.3: NEWS ext/mysqli/mysqli.c ext/mysqli/tests/bug64726.phpt
| From: | Xinchen Hui | Date: | Sat, 27 Apr 2013 15:49:43 +0000 |
| Subject: | com php-src: Also fixed bug #64726 in 5.3: NEWS ext/mysqli/mysqli.c ext/mysqli/tests/bug64726.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-72054@lists.php.net to get a copy of this message | ||
Commit: 15b554cd9ba6b8553f45ea8408b3f0386965bef6
Author: Xinchen Hui <laruence@php.net> Sat, 27 Apr 2013 23:49:43 +0800
Parents: c7b8368ed579ddd539af95427902215f0530b4ea
Branches: PHP-5.3 PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=15b554cd9ba6b8553f45ea8408b3f0386965bef6
Log:
Also fixed bug #64726 in 5.3
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 5ea0f5a..284a31a 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2013, PHP 5.3.26
+- MySQLi:
+ . Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB
+ pointer has closed). (Laruence)
+
?? ??? 2013, PHP 5.3.25
### ADD ENTRIES ABOVE FOR 5.3.26. 5.3.25 NEWS WILL BE UPDATED BY RM ON MERGE ###
diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c
index 86f6070..2941b4a 100644
--- a/ext/mysqli/mysqli.c
+++ b/ext/mysqli/mysqli.c
@@ -1259,7 +1259,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int
override_flags
#endif
- 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..83c4e3c 100644
--- a/ext/mysqli/tests/bug64726.phpt
+++ b/ext/mysqli/tests/bug64726.phpt
@@ -16,8 +16,8 @@ $db = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
$result = $db->query('SELECT 1', MYSQLI_USE_RESULT);
$db->close();
-var_dump($result->fetch_array());
+var_dump($result->fetch_object());
?>
--EXPECTF--
-Warning: mysqli_result::fetch_array(): Error while reading a row in %sbug64726.php on line %d
+Warning: mysqli_result::fetch_object(): Error while reading a row in %sbug64726.php on line %d
bool(false)