|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2017-10-17 00:21 UTC] bwoebi@php.net
Description:
------------
Assign-adding an array to an object leads to an use-after-free.
Test script:
---------------
$o = new stdClass;
$o += [];
Expected result:
----------------
Notice: Object of class stdClass could not be converted to int in - on line 1
Fatal error: Uncaught Error: Unsupported operand types in -:1
Stack trace:
#0 {main}
thrown in - on line 1
Actual result:
--------------
Invalid read
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 21 11:00:02 2025 UTC |
Similarly: php -r 'set_error_handler(function() { throw new \Exception; }); $a = "2"; $a .= "a"; try { $a+=1; } catch (\Exception $e) { } var_dump($a);' int(3) (instead of string(2) "2a") (turns out the crash has already been fixed in the most recent git, but not yet in the last release. - renaming thus.)