|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #80173 Using return value of zend_assign_to_variable() is not safe
Submitted: 2020-10-02 10:33 UTC Modified: -
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 7.4.11 OS:
Private report: No CVE-ID: None
 [2020-10-02 10:33 UTC]
Reduced from oss-fuzz #25840:

$a = new stdClass; 
$a->a =& $a;
var_dump($a->a = 0);

zend_assign_to_variable() returns variable_ptr, which might be destroyed by the assignment.

The root cause here is the same as in bug #80100, but the reproducer is more fundamental.

Probably the only way to address this is to add a separate version of zend_assign_to_variable() that accepts a zval to copy the value into, and perform that copy before disposing garbage.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-07-02 08:09 UTC]
Automatic comment on behalf of nikic
Log: Fixed bug #80173
 [2021-07-02 08:09 UTC]
-Status: Open +Status: Closed
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Feb 04 06:05:49 2023 UTC