From 86e1fea39accf90ce658a21082c7c5f523ba163a Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Fri, 14 Oct 2022 19:32:17 +0200 Subject: [PATCH 1/3] Restore extra_named_params when restoring frozen call stack --- Zend/tests/generators/gh9752.phpt | 22 ++++++++++++++++++++++ Zend/zend_generators.c | 1 + 2 files changed, 23 insertions(+) create mode 100644 Zend/tests/generators/gh9752.phpt diff --git a/Zend/tests/generators/gh9752.phpt b/Zend/tests/generators/gh9752.phpt new file mode 100644 index 00000000000..69aab2c0990 --- /dev/null +++ b/Zend/tests/generators/gh9752.phpt @@ -0,0 +1,22 @@ +--TEST-- +Bug GH-9752 (Generator crashes when interrupted during a function call with extra named params) +--FILE-- + +==DONE== +--EXPECT-- +==DONE== diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c index 43385231fbe..a62ebaf5e35 100644 --- a/Zend/zend_generators.c +++ b/Zend/zend_generators.c @@ -44,6 +44,7 @@ ZEND_API void zend_generator_restore_call_stack(zend_generator *generator) /* {{ ZEND_CALL_NUM_ARGS(call), Z_PTR(call->This)); memcpy(((zval*)new_call) + ZEND_CALL_FRAME_SLOT, ((zval*)call) + ZEND_CALL_FRAME_SLOT, ZEND_CALL_NUM_ARGS(call) * sizeof(zval)); + new_call->extra_named_params = call->extra_named_params; new_call->prev_execute_data = prev_call; prev_call = new_call; From f702f87f70e9c2553171bd31ba13f0dc1974478d Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Sun, 16 Oct 2022 12:43:21 +0200 Subject: [PATCH 2/3] [ci skip] NEWS --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index a8dabe55c9b..5613b1178b0 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? 2022, PHP 8.0.26 +- Core: + . Fixed bug GH-9752 (Generator crashes when interrupted during argument + evaluation with extra named params). (Arnaud) + - SOAP: . Fixed GH-9720 (Null pointer dereference while serializing the response). (cmb) From e3c40c682946bb1fdf4c6ad3fd0b2d9a9c720fc7 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Sun, 16 Oct 2022 12:44:05 +0200 Subject: [PATCH 3/3] [ci skip] NEWS --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index d743b3d4fb2..f38cd07a956 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.1.13 +- Core: + . Fixed bug GH-9752 (Generator crashes when interrupted during argument + evaluation with extra named params). (Arnaud) + - MySQLnd: . Fixed potential heap corruption due to alignment mismatch. (cmb)