diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-01-15 16:58:01 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-01-15 16:58:31 +0100 |
commit | 21562aa98dd423a988770aee974377a77d980839 (patch) | |
tree | 832deae28906d3caa69a82bb134c317156143ef8 /Zend/zend_compile.c | |
parent | 3e01f5afb1b52fe26a956190296de0192eedeec1 (diff) | |
download | php-git-21562aa98dd423a988770aee974377a77d980839.tar.gz |
Check for append to $GLOBALS
Fixes oss-fuzz #29389.
Diffstat (limited to 'Zend/zend_compile.c')
-rw-r--r-- | Zend/zend_compile.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 58cd190b68..06c0034bc2 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -2773,6 +2773,10 @@ static zend_op *zend_delayed_compile_dim(znode *result, zend_ast *ast, uint32_t znode var_node, dim_node; if (is_globals_fetch(var_ast)) { + if (dim_ast == NULL) { + zend_error_noreturn(E_COMPILE_ERROR, "Cannot append to $GLOBALS"); + } + zend_compile_expr(&dim_node, dim_ast); if (dim_node.op_type == IS_CONST) { convert_to_string(&dim_node.u.constant); |