summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-01-15 16:58:01 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-01-15 16:58:31 +0100
commit21562aa98dd423a988770aee974377a77d980839 (patch)
tree832deae28906d3caa69a82bb134c317156143ef8 /Zend/zend_compile.c
parent3e01f5afb1b52fe26a956190296de0192eedeec1 (diff)
downloadphp-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.c4
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);