postgresql/src/bin
Andrew Dunstan d3bb7841b4 Fix multiple bugs in astreamer pipeline code.
astreamer_tar_parser_content() sent the wrong data pointer when
forwarding MEMBER_TRAILER padding to the next streamer.  After
astreamer_buffer_until() buffers the padding bytes, the 'data'
pointer has been advanced past them, but the code passed 'data'
instead of bbs_buffer.data.  This caused the downstream consumer
to receive bytes from after the padding rather than the padding
itself, and could read past the end of the input buffer.

astreamer_gzip_decompressor_content() only checked for
Z_STREAM_ERROR from inflate(), silently ignoring Z_DATA_ERROR
(corrupted data) and Z_MEM_ERROR (out of memory).  Fix by
treating any return other than Z_OK, Z_STREAM_END, and
Z_BUF_ERROR as fatal.

astreamer_gzip_decompressor_free() missed calling inflateEnd() to
release zlib's internal decompression state.

astreamer_tar_parser_free() neglected to pfree() the streamer
struct itself, leaking it.

astreamer_extractor_content() did not check the return value of
fclose() when closing an extracted file.  A deferred write error
(e.g., disk full on buffered I/O) would be silently lost.

Discussion: https://postgr.es/m/results/98c6b630-acbb-44a7-97fa-1692ce2b827c@dunslane.net

Reviewed-By: Tom Lane <tgl@sss.pgh.pa.us>

Backpatch-through: 15
2026-03-29 09:12:40 -04:00
..
initdb Translation updates 2026-02-08 15:11:05 +01:00
pg_amcheck Translation updates 2026-02-08 15:11:05 +01:00
pg_archivecleanup Translation updates 2026-02-08 15:11:05 +01:00
pg_basebackup Fix multiple bugs in astreamer pipeline code. 2026-03-29 09:12:40 -04:00
pg_checksums Translation updates 2026-02-08 15:11:05 +01:00
pg_config Translation updates 2026-02-08 15:11:05 +01:00
pg_controldata Translation updates 2026-02-08 15:11:05 +01:00
pg_ctl Translation updates 2026-02-08 15:11:05 +01:00
pg_dump Translation updates 2026-02-08 15:11:05 +01:00
pg_resetwal Translation updates 2026-02-23 14:03:47 +01:00
pg_rewind Translation updates 2026-02-23 14:03:47 +01:00
pg_test_fsync Translation updates 2026-02-08 15:11:05 +01:00
pg_test_timing Translation updates 2026-02-08 15:11:05 +01:00
pg_upgrade pg_upgrade: Use max_protocol_version=3.0 for older servers 2026-02-24 14:01:54 -08:00
pg_verifybackup Translation updates 2026-02-08 15:11:05 +01:00
pg_waldump Fix some cases of indirectly casting away const. 2026-02-25 11:19:50 -05:00
pgbench Fix some cases of indirectly casting away const. 2026-02-25 11:19:50 -05:00
pgevent Update copyright for 2022 2022-01-07 19:04:57 -05:00
psql Translation updates 2026-02-23 14:03:47 +01:00
scripts Translation updates 2026-02-08 15:11:05 +01:00
Makefile Update copyright for 2022 2022-01-07 19:04:57 -05:00