[php-src] Issue #21799: phar: phar_stream_close silently discards phar_stream_flush failure

[email protected] (iliaal)
Newsgroups php.bugs
Message-ID <[email protected]>
Issue: https://github.com/php/php-src/issues/21799
Author: iliaal

`phar_stream_close` in `ext/phar/stream.c` calls `phar_stream_flush` but discards its return value, always returning 0 (success) from `fclose()` even when the flush failed.

If `phar_stream_flush` encounters a write error (e.g. out of disk space while committing phar modifications), the application gets no indication of failure from `fclose($fp)`.

Location: `phar_stream_close` — `phar_stream_flush(stream);` return value is silently dropped.

Fix: capture the flush return value and return it from `phar_stream_close`.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.