mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +08:00
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 bef47ff85d
introduced
this problem.
Report and patch by Antonin Houska.
Discussion: http://postgr.es/m/15764.1670528645@antos
This commit is contained in:
parent
df8b8968d4
commit
45f5c81ad2
@ -1073,6 +1073,7 @@ sendFileWithContent(bbsink *sink, const char *filename, const char *content,
|
||||
memcpy(sink->bbs_buffer, content, nbytes);
|
||||
bbsink_archive_contents(sink, nbytes);
|
||||
bytes_done += nbytes;
|
||||
content += nbytes;
|
||||
}
|
||||
|
||||
_tarWritePadding(sink, len);
|
||||
|
Loading…
Reference in New Issue
Block a user