[php-src] PR #19319: Fix GH-19300: Nested array_multisort invocation with error breaks
| From: | nielsdos | Date: | Wed, 30 Jul 2025 17:19:56 +0000 |
| Subject: | [php-src] PR #19319: Fix GH-19300: Nested array_multisort invocation with error breaks | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-32715@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/19319
Author: nielsdos
There are 2 issues:
1. When a MULTISORT_ABORT happens, it frees func, but func may point to ARRAYG(multisort_func),
which would be a problem with nested invocations as it can destroy that of the "parent"
invocation. To solve this, delay assigning to the globals.
2. The old globals were not restored which means that nested invocations with different flags will
cause a wrong sorting function to be used.