[php-src] PR #16059: Fix GH-15168: stack overflow in json_encode()
| From: | nielsdos | Date: | Wed, 25 Sep 2024 16:01:07 +0000 |
| Subject: | [php-src] PR #16059: Fix GH-15168: stack overflow in json_encode() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-28795@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/16059
Author: nielsdos
The JSON encoder is recursive, and it's far from easy to make it iterative. Add a cheap stack
limit check to prevent a segfault. This uses the PHP_JSON_ERROR_DEPTH error code that already talks
about the stack depth. Previously this was only used for the $depth argument.