pgsql: Use ArchiveHandle.lookaheadSize instead of a hardcoded 512
Use ArchiveHandle.lookaheadSize instead of a hardcoded 512
_discoverArchiveFormat allocates the lookahead buffer used to identify
the archive format and records its size in AH->lookaheadSize, but then
used a hardcoded size in the two plades that need it. Use the field
instead, so that the buffer and its size cannot drift apart and risk
out-of-bound reads.
Author: Aleksander Alekseev <aleksander@tigerdata.com>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: /messages/by-id/CAJ7c6TPqLZOMk3hPrgLQvrOg9BCY4SV6bUC_wx54fyquRkBckw@mail.gmail.com
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/8646214ee20b3754d69f9d087baa7eeb1b7e1d0b
Modified Files
--------------
src/bin/pg_dump/pg_backup_archiver.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)