pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Use ArchiveHandle.lookaheadSize instead of a hardcoded 512
Date: Mon, 24 Aug 2026 08:11:18 +0000
Message-ID: <E1wyPm1-00000001sOx-0BSl@gemulon.postgresql.org> (raw)

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: https://postgr.es/m/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(-)



Message-ID: <E1wyPm1-00000001sOx-0BSl@gemulon.postgresql.org>
Permalink:  ../E1wyPm1-00000001sOx-0BSl@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wyPm1-00000001sOx-0BSl@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Use ArchiveHandle.lookaheadSize instead of a hardcoded 512
  In-Reply-To: <E1wyPm1-00000001sOx-0BSl@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox