[php-src] PR #25034: ext/standard: Handle file_put_contents() truncation failures
| From: | iliaal | Date: | Thu, 29 Oct 2026 14:59:50 +0000 |
| Subject: | [php-src] PR #25034: ext/standard: Handle file_put_contents() truncation failures | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-40057@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/25034
Author: iliaal
Static review found that
file_put_contents() with LOCK_EX reports success after a
truncation failure and can leave old file contents behind. It now stops before writing when
truncation fails, while preserving writes to native devices such as /dev/null and NUL. Reproduced
with a stream wrapper and injected native-file errors on Linux.