[php-src] PR #25478: Add native stack limit check to unserialize()
| From: | Volkopat | Date: | Mon, 16 Nov 2026 06:56:45 +0000 |
| Subject: | [php-src] PR #25478: Add native stack limit check to unserialize() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40671@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25478
Author: Volkopat
php_var_unserialize_internal() recursed with no stack limit check. unserialize_max_depth bounds the
nesting, but it can be set to 0, and the default depth can still exhaust a smaller stack such as a
fiber's, so deeply nested input could crash unserialize() (GH-24605).
Check the stack limit on entry and throw the usual "Maximum call stack size" Error,
matching serialize(), var_dump() and var_export(). The caller already suppresses the "Error at
offset" warning when an exception is pending.