Skip to content

Commit 9f245b8

Browse files
committed
Fix use-of-uninitialized-value in start_fake_frame
1 parent b0bc057 commit 9f245b8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Zend/zend_execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5049,7 +5049,7 @@ zval * ZEND_FASTCALL zend_handle_named_arg(
50495049
}
50505050

50515051
static zend_execute_data *start_fake_frame(zend_execute_data *call, const zend_op *opline) {
5052-
zend_execute_data *old_prev_execute_data = call->prev_execute_data;
5052+
zend_execute_data *old_prev_execute_data = ZEND_USER_CODE(call->func->common.type) ? call->prev_execute_data : NULL;
50535053
call->prev_execute_data = EG(current_execute_data);
50545054
call->opline = opline;
50555055
EG(current_execute_data) = call;

Zend/zend_execute_API.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,8 @@ zend_result zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_
897897
}
898898

899899
if (UNEXPECTED(ZEND_CALL_INFO(call) & ZEND_CALL_MAY_HAVE_UNDEF)) {
900+
/* zend_handle_undef_args assumes prev_execute_data is initialized for user calls. */
901+
call->prev_execute_data = NULL;
900902
if (zend_handle_undef_args(call) == FAILURE) {
901903
zend_vm_stack_free_args(call);
902904
zend_vm_stack_free_call_frame(call);

0 commit comments

Comments
 (0)