|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
New email:
PHP Version: OS:


 [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-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 20 03:02:00 2024 UTC