We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e528b2 commit 2a1a8f9Copy full SHA for 2a1a8f9
Zend/tests/bug70183.phpt
@@ -0,0 +1,8 @@
1
+--TEST--
2
+Bug #70183 (null pointer deref (segfault) in zend_eval_const_expr)
3
+--FILE--
4
+<?php
5
+[[][]]
6
+?>
7
+--EXPECTF--
8
+Fatal error: Cannot use [] for reading in %sbug70183.php on line %d
Zend/zend_compile.c
@@ -7374,7 +7374,7 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
7374
7375
zend_eval_const_expr(&ast->child[0]);
7376
zend_eval_const_expr(&ast->child[1]);
7377
- if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
+ if (!ast->child[0] || !ast->child[1] || ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {
7378
return;
7379
}
7380
0 commit comments