Skip to content

Commit 379edc9

Browse files
iluuu1994DanielEScherzer
authored andcommitted
Fix use-after-free
The ast contained in ast_copy_ref is already destroyed by zend_const_expr_to_zval(). Avoid the double free by just freeing the ast ref itself.
1 parent f28cace commit 379edc9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Zend/zend_compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7463,7 +7463,7 @@ void zend_compile_attributes(
74637463
zend_const_expr_to_zval(
74647464
&attr->args[j].value, extra_ptr, /* allow_dynamic */ true);
74657465
zend_ast_destroy(*extra_ptr);
7466-
zend_ast_ref_destroy(ast_copy_ref);
7466+
efree(ast_copy_ref);
74677467
} else {
74687468
zend_const_expr_to_zval(
74697469
&attr->args[j].value, arg_ast_ptr, /* allow_dynamic */ true);

0 commit comments

Comments
 (0)