pgsql: Fix failure to advance content pointer in sendFileWithContent.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix failure to advance content pointer in sendFileWithContent.
Date: 2022-12-12 15:39:48
Message-ID: E1p4kuB-003EBm-Hc@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix failure to advance content pointer in sendFileWithContent.

If sendFileWithContent were used to send a file larger than the
bbsink buffer size, this would result in corruption. The only
files that are sent via sendFileWithContent are the backup label
file, the tablespace map file, and .done files for WAL segments
included in the backup. Of these, it seems that only the
tablespace_map file can become large enough to cause a problem,
and then only if you have a lot of tablespaces. If you do have
that situation, you might end up with a corrupted
tablespace_map file, which would be bad.

My commit bef47ff85df18bf4a3a9b13bd2a54820e27f3614 introduced
this problem.

Report and patch by Antonin Houska.

Discussion: http://postgr.es/m/15764.1670528645@antos

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8b5ba2f3f40a9c82623a19b551bc5790a84275a2

Modified Files
--------------
src/backend/backup/basebackup.c | 1 +
1 file changed, 1 insertion(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Jeff Davis 2022-12-12 17:51:33 pgsql: Remove extra space from dumped ALTER DEFAULT PRIVILEGES.
Previous Message Peter Eisentraut 2022-12-12 14:22:16 pgsql: Order getopt arguments