pg_basebackup: Fix use of externally-controlled format string

appendPQExpBuffer() was accidentally used instead of
appendBinaryPQExpBuffer() in pg_basebackup.  The former would
interpret the string to be appended as a format string, which could
lead to misbehavior.  (The string contents are related to backup
manifest contents.  Those do not normally contain any data that could
look like a format placeholders.  In order for this to misbehave,
files with unusual names would have to exist in the data directory.)

- The hunk in ReceiveBackupManifestInMemoryChunk() is from commit
  0d8c9c1210c, 2020, PG13.

Security: CVE-2026-16240
Backpatch-through: 14

Branch
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/50f650b91b83a7cf0ee764b6e3ac8faed129e541
Author: Peter Eisentraut <[email protected]>

Modified Files
--------------
src/bin/pg_basebackup/pg_basebackup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Reply via email to