Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix access on NULL when printing backtrace with freed generator #15952

Open
wants to merge 1 commit into
base: PHP-8.2
Choose a base branch
from

Conversation

iluuu1994
Copy link
Member

Fixes GH-15851

Master additionally needs:

diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 9da4a76825..b7595ce7d3 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1895,7 +1895,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
 		}
 
 		/* For frameless calls we add an additional frame for the call itself. */
-		if (ZEND_USER_CODE(call->func->type)) {
+		if (call->func && ZEND_USER_CODE(call->func->type)) {
 			const zend_op *opline = call->opline;
 			if (!ZEND_OP_IS_FRAMELESS_ICALL(opline->opcode)) {
 				goto not_frameless_call;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants