php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75420 Crash when modifing property name in __isset for BP_VAR_IS
Submitted: 2017-10-23 20:00 UTC Modified: 2017-10-24 01:31 UTC
From: nikic@php.net Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 7.0.24 OS:
Private report: No CVE-ID: None
 [2017-10-23 20:00 UTC] nikic@php.net
Description:
------------
$name is changed from string to int in the __isset() call, so that the subsequent __get() call crashes.

Test script:
---------------
<?php

class Test {
    public function __isset($x) { $GLOBALS['name'] = 24; return true; }
    public function __get($x) { var_dump($x); return 42; }
}

$obj = new Test;
$name = "foo";
var_dump($obj->$name ?? 12);



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-10-24 01:31 UTC] kalle@php.net
-Status: Open +Status: Verified
 [2017-10-26 02:19 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=d2047503cbc080ef96b00ac254604aaa01cf618e
Log: Fixed bug #75420 (Crash when modifing property name in __isset for BP_VAR_IS)
 [2017-10-26 02:19 UTC] laruence@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC