[php-src] PR #21492: ext/bcmath: Fix bc_str2num accepting strings with embedded null bytes
| From: | jorgsowa | Date: | Sun, 22 Mar 2026 17:57:59 +0000 |
| Subject: | [php-src] PR #21492: ext/bcmath: Fix bc_str2num accepting strings with embedded null bytes | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-35305@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21492
Author: jorgsowa
bc_str2num accepts an explicit end boundary pointer but validated input using
null-terminator checks (*ptr != '\0'). This caused strings with embedded null bytes to be
silently truncated rather than rejected.
"100\x005" was parsed as "100" while
"100a5" correctly threw a ValueError.