pgsql: Fix finalization of decompressor astreamers.

Started by Tom Lane4 months ago1 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

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@dunslane.net>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: /messages/by-id/2178517.1774064942@sss.pgh.pa.us
Backpatch-through: 15

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5f9642614275a56c93774ce536feaa4c27ee2525

Modified Files
--------------
src/fe_utils/astreamer_gzip.c | 9 +++++----
src/fe_utils/astreamer_lz4.c | 9 +++++----
src/fe_utils/astreamer_zstd.c | 2 +-
3 files changed, 11 insertions(+), 9 deletions(-)