mirror of
https://github.com/php/php-src.git
synced 2026-03-26 09:12:14 +01:00
Merge branch 'PHP-5.4'
Conflicts: Zend/zend_vm_def.h
This commit is contained in:
12
Zend/tests/bug63173.phpt
Normal file
12
Zend/tests/bug63173.phpt
Normal file
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
Bug #63173: Crash when invoking invalid array callback
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
// the important part here are the indexes 1 and 2
|
||||
$callback = [1 => 0, 2 => 0];
|
||||
$callback();
|
||||
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Array callback has to contain indices 0 and 1 in %s on line %d
|
||||
@@ -2807,6 +2807,10 @@ ZEND_VM_HANDLER(59, ZEND_INIT_FCALL_BY_NAME, ANY, CONST|TMP|VAR|CV)
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
|
||||
|
||||
if (!obj || !method) {
|
||||
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
|
||||
}
|
||||
|
||||
@@ -1458,6 +1458,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CONST_HANDLER(ZEND_OPCODE
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
|
||||
|
||||
if (!obj || !method) {
|
||||
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
|
||||
}
|
||||
@@ -1774,6 +1778,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_TMP_HANDLER(ZEND_OPCODE_H
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
|
||||
|
||||
if (!obj || !method) {
|
||||
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
|
||||
}
|
||||
@@ -1940,6 +1948,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_VAR_HANDLER(ZEND_OPCODE_H
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
|
||||
|
||||
if (!obj || !method) {
|
||||
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
|
||||
}
|
||||
@@ -2141,6 +2153,10 @@ static int ZEND_FASTCALL ZEND_INIT_FCALL_BY_NAME_SPEC_CV_HANDLER(ZEND_OPCODE_HA
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 0, (void **) &obj);
|
||||
zend_hash_index_find(Z_ARRVAL_P(function_name), 1, (void **) &method);
|
||||
|
||||
if (!obj || !method) {
|
||||
zend_error_noreturn(E_ERROR, "Array callback has to contain indices 0 and 1");
|
||||
}
|
||||
|
||||
if (Z_TYPE_PP(obj) != IS_STRING && Z_TYPE_PP(obj) != IS_OBJECT) {
|
||||
zend_error_noreturn(E_ERROR, "First array member is not a valid class name or object");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user