mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-27 10:55:42 +00:00
Merge branch 'PHP-7.0'
This commit is contained in:
commit
36cd300693
2 files changed
+19
-2
No files matched your search
@@ -0,0 +1,10 @@
|
||||
--TEST--
|
||||
Bug #70782: null ptr deref and segfault (zend_get_class_fetch_type)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
(-0)::$prop;
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Illegal class name in %s on line %d
|
||||
+9
-2
@@ -2126,8 +2126,15 @@ static zend_op *zend_compile_class_ref(znode *result, zend_ast *name_ast, int th
|
||||
zend_compile_expr(&name_node, name_ast);
|
||||
|
||||
if (name_node.op_type == IS_CONST) {
|
||||
zend_string *name = Z_STR(name_node.u.constant);
|
||||
uint32_t fetch_type = zend_get_class_fetch_type(name);
|
||||
zend_string *name;
|
||||
uint32_t fetch_type;
|
||||
|
||||
if (Z_TYPE(name_node.u.constant) != IS_STRING) {
|
||||
zend_error_noreturn(E_COMPILE_ERROR, "Illegal class name");
|
||||
}
|
||||
|
||||
name = Z_STR(name_node.u.constant);
|
||||
fetch_type = zend_get_class_fetch_type(name);
|
||||
|
||||
opline = zend_emit_op(result, ZEND_FETCH_CLASS, NULL, NULL);
|
||||
opline->extended_value = fetch_type | (throw_exception ? ZEND_FETCH_CLASS_EXCEPTION : 0);
|
||||
|
||||
Reference in new issue
Block a user