Bug #74968 [Opn->Csd]: PHP crashes when calling mysqli_result::fetch_object with an abstract class
| From: | ab@php.net | Date: | Sat, 22 Jul 2017 08:37:54 +0000 |
| Subject: | Bug #74968 [Opn->Csd]: PHP crashes when calling mysqli_result::fetch_object with an abstract class | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210183@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74968&edit=1
ID: 74968
Updated by: ab@php.net
Reported by: toto at linux dot com
Summary: PHP crashes when calling mysqli_result::fetch_object
with an abstract class
-Status: Open
+Status: Closed
Type: Bug
Package: MySQLi related
Operating System: Windows
PHP Version: 7.1.7
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e405ff59f9e5873a3aa8dc6b7175708d424007b9
Log: Fixed bug #74968 PHP crashes when calling mysqli_result::fetch_object with an abstract class
Previous Comments:
------------------------------------------------------------------------
[2017-07-22 04:56:59] toto at linux dot com
Description:
------------
So I wrote some faulty code this morning that tried to do
$mysqli_result->fetch_object("SomeAbstractClass"); and it ended up crashing the whole
PHP.
I tested this also on PHP 7.0.18 on Ubuntu and it also ended up with a segmentation fault.
Test script:
---------------
<?php
$mysqli = new mysqli("127.0.0.1", "xxx", "xxx", "test");
abstract class test {
public $a;
}
$mysqli->query("SELECT 1 as a")->fetch_object("test");
Expected result:
----------------
PHP should give me some error instead of just crashing.
Actual result:
--------------
Segmentation fault, the whole PHP crashes.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74968&edit=1