Skip to content

Commit 15b554c

Browse files
committed
Also fixed bug #64726 in 5.3
1 parent c7b8368 commit 15b554c

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2013, PHP 5.3.26
44

5+
- MySQLi:
6+
. Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB
7+
pointer has closed). (Laruence)
8+
59
?? ??? 2013, PHP 5.3.25
610

711
### ADD ENTRIES ABOVE FOR 5.3.26. 5.3.25 NEWS WILL BE UPDATED BY RM ON MERGE ###

ext/mysqli/mysqli.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
12591259

12601260
#endif
12611261

1262-
if (into_object && Z_TYPE_P(return_value) != IS_NULL) {
1262+
if (into_object && Z_TYPE_P(return_value) == IS_ARRAY) {
12631263
zval dataset = *return_value;
12641264
zend_fcall_info fci;
12651265
zend_fcall_info_cache fcc;

ext/mysqli/tests/bug64726.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ $db = new my_mysqli($host, $user, $passwd, $db, $port, $socket);
1616

1717
$result = $db->query('SELECT 1', MYSQLI_USE_RESULT);
1818
$db->close();
19-
var_dump($result->fetch_array());
19+
var_dump($result->fetch_object());
2020
?>
2121
--EXPECTF--
22-
Warning: mysqli_result::fetch_array(): Error while reading a row in %sbug64726.php on line %d
22+
Warning: mysqli_result::fetch_object(): Error while reading a row in %sbug64726.php on line %d
2323
bool(false)

0 commit comments

Comments
 (0)