[php-src] PR #21817: Throw a ValueError when the parameter includes NUL bytes in `putenv`
| From: | LamentXU123 | Date: | Tue, 21 Apr 2026 08:00:32 +0000 |
| Subject: | [php-src] PR #21817: Throw a ValueError when the parameter includes NUL bytes in `putenv` | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-35811@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/21817
Author: LamentXU123
Currently string in
putenv can be truncated by NUL:
```php
<?php
var_dump(putenv("PHP_PUTENV_NUL_TEST=va\0ue"));
echo getenv('PHP_PUTENV_NUL_TEST');
```
output:
```
bool(true)
va
```
Reproduce in https://3v4l.org/BEHSh
According to the newest policy these cases are supposed to resulted in a ValueError.