mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix use of magic const within const expr cast (GH-18338)
Fixes OSS-Fuzz #410939023
This commit is contained in:
11
Zend/tests/oss_fuzz_410939023.phpt
Normal file
11
Zend/tests/oss_fuzz_410939023.phpt
Normal file
@@ -0,0 +1,11 @@
|
||||
--TEST--
|
||||
OSS-Fuzz #410939023: Use of magic const within const expr cast
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
const C = (string)__METHOD__;
|
||||
var_dump(C);
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
string(0) ""
|
||||
@@ -12127,6 +12127,9 @@ static void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
zend_eval_const_expr(&ast->child[1]);
|
||||
return;
|
||||
case ZEND_AST_CAST:
|
||||
zend_eval_const_expr(&ast->child[0]);
|
||||
return;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user