diff options
author | Xinchen Hui <laruence@php.net> | 2013-04-27 23:49:43 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2013-04-27 23:49:43 +0800 |
commit | 15b554cd9ba6b8553f45ea8408b3f0386965bef6 (patch) | |
tree | 3675a65334498434ac47375b813a1db97a69957c | |
parent | c7b8368ed579ddd539af95427902215f0530b4ea (diff) | |
download | php-git-15b554cd9ba6b8553f45ea8408b3f0386965bef6.tar.gz |
Also fixed bug #64726 in 5.3
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/mysqli/mysqli.c | 2 | ||||
-rw-r--r-- | ext/mysqli/tests/bug64726.phpt | 4 |
3 files changed, 7 insertions, 3 deletions
@@ -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 86f6070e6d..2941b4a899 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 3e43916d35..83c4e3c1e9 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) |