From c25c8a1f25bf5ed40fbbd8642d72865dd68d054d Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sun, 17 Aug 2025 16:13:51 +0200 Subject: Fix a NULL-ptr deref ``` Program terminated with signal SIGSEGV, Segmentation fault. 20 if (!(func->common.function_name)) { (gdb) info locals func = 0x0 function_name = 0xffb25f6d0190 "SearchByCallback" complete_path_function = 0xffb26c8a0570 "\240\005\212l\262\377" ``` It seems that in some callback shenanigans, there is currently no non-NULL `func` member in execute_data. PHP truly is marvelous. This should close #515 --- src/sp_disabled_functions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sp_disabled_functions.c') diff --git a/src/sp_disabled_functions.c b/src/sp_disabled_functions.c index 10a9466..050c023 100644 --- a/src/sp_disabled_functions.c +++ b/src/sp_disabled_functions.c @@ -17,7 +17,7 @@ char* get_complete_function_path(zend_execute_data const* const execute_data) { return NULL; // LCOV_EXCL_LINE } const zend_function *const func = execute_data->func; - if (!(func->common.function_name)) { + if (!func || !(func->common.function_name)) { return NULL; } -- cgit v1.3