[php-src] PR #24224: Issue 24223 - Fix sign overflow when converting pw_uid and pw_gid to zend_long
| From: | lynayur | Date: | Fri, 09 Oct 2026 18:46:20 +0000 |
| Subject: | [php-src] PR #24224: Issue 24223 - Fix sign overflow when converting pw_uid and pw_gid to zend_long | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-39294@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/24224
Author: lynayur
Fixes [#24223](https://github.com/php/php-src/issues/24223)
Solution:
compared pw_uid and pw_gid with ZEND_LONG_MAX before the conversion and passed values that do not
fit to add_assoc_double() instead of add_assoc_long(), so the returned uid/gid is never
sign-flipped. On 64-bit builds the condition is never true, so their behavior is unchanged.
Signed-off-by: Stanislav Pichugin \<[s.pichugin@fobos-nt.ru](mailto:s.pichugin@fobos-nt.ru)\>
Signed-off-by: Georgij Tsarin \<[crystarm@altlinux.org](mailto:crystarm@altlinux.org)\>