Skip to content

Commit 45e224c

Browse files
adsrdevnexen
authored andcommitted
Fix GH-9709: Guard against current_execute_data==NULL in is_handle_exception_set
1 parent fa1b6ab commit 45e224c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

+3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
33
?? ??? 2022, PHP 8.0.26
44

5+
- CLI:
6+
. Fixed bug GH-9709 (Null pointer dereference with -w/-s options). (Adam Saponara)
7+
58
- Core:
69
. Fixed bug GH-9752 (Generator crashes when interrupted during argument
710
evaluation with extra named params). (Arnaud)

Zend/zend_exceptions.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ void zend_exception_restore(void) /* {{{ */
146146

147147
static zend_always_inline zend_bool is_handle_exception_set() {
148148
zend_execute_data *execute_data = EG(current_execute_data);
149-
return !execute_data->func
149+
return !execute_data
150+
|| !execute_data->func
150151
|| !ZEND_USER_CODE(execute_data->func->common.type)
151152
|| execute_data->opline->opcode == ZEND_HANDLE_EXCEPTION;
152153
}

0 commit comments

Comments
 (0)