Bug #64726 [Asn->Csd]: Segfault when calling fetch_object on a use_result and DB pointer has closed
Edit report at https://bugs.php.net/bug.php?id=64726&edit=1
ID: 64726
Updated by: laruence@php.net
Reported by: justin at eblah dot com
Summary: Segfault when calling fetch_object on a use_result
and DB pointer has closed
-Status: Assigned
+Status: Closed
Type: Bug
Package: MySQLi related
Operating System: CentOS 5.9
PHP Version: 5.4.14
Assigned To: mysql
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8f5a534b215905790a4dd5465804c1fbc21468c4
Log: Fixed bug #64726 (Segfault when calling fetch_object on a use_result and DB pointer has closed)
Previous Comments:
------------------------------------------------------------------------
[2013-04-26 17:46:11] justin at eblah dot com
Reworded summary.
------------------------------------------------------------------------
[2013-04-26 17:35:58] justin at eblah dot com
Description:
------------
When using MYSQLI_USE_RESULT, then immediately closing the database, and then attempting to
fetch_object() the result will result in a segmentation fault.
PHP does not segfault if using fetch_array() or fetch_assoc().
Test script:
---------------
<?php
$db = new mysqli("127.0.0.1", "root", "root", "test");
$result = $db->query('SELECT 1', MYSQLI_USE_RESULT);
$db->close();
$result->fetch_object();
Expected result:
----------------
An exception or php fatal error that states the database was closed.
Actual result:
--------------
[root@devz user]# /usr/bin/php segfault.php
Warning: mysqli_result::fetch_object(): Error while reading a row in segfault.php on line 15
Segmentation fault
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64726&edit=1
Thread (4 messages)