pgsql: Fix finalization of decompressor astreamers.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix finalization of decompressor astreamers.
Date: 2026-03-22 22:07:03
Message-ID: E1w4Qwo-000zUW-2s@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix finalization of decompressor astreamers.

Send the correct amount of data to the next astreamer, not the
whole allocated buffer size. This bug escaped detection because
in present uses the next astreamer is always a tar-file parser
which is insensitive to trailing garbage. But that may not
be true in future uses.

Author: Andrew Dunstan <andrew(at)dunslane(dot)net>
Reviewed-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Discussion: https://postgr.es/m/2178517.1774064942@sss.pgh.pa.us
Backpatch-through: 15

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/80785a527b9cf74b16cb5bb65355f94157124bf7

Modified Files
--------------
src/bin/pg_basebackup/bbstreamer_gzip.c | 9 +++++----
src/bin/pg_basebackup/bbstreamer_lz4.c | 9 +++++----
src/bin/pg_basebackup/bbstreamer_zstd.c | 2 +-
3 files changed, 11 insertions(+), 9 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-03-22 22:24:49 pgsql: Remove nonfunctional tar file trailer size check.
Previous Message Peter Geoghegan 2026-03-22 21:32:03 pgsql: Add fake LSN support to hash index AM.