Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita50e4fd

Browse files
committed
Prevent buffer overrun in read_tablespace_map().
Robert Foggia of Trustwave reported that read_tablespace_map()fails to prevent an overrun of its on-stack input buffer.Since the tablespace map file is presumed trustworthy, this doesnot seem like an interesting security vulnerability, but stillwe should fix it just in the name of robustness.While here, document that pg_basebackup's --tablespace-mapping optiondoesn't work with tar-format output, because it doesn't. To make itwork, we'd have to modify the tablespace_map file within the tarballsent by the server, which might be possible but I'm not volunteering.(Less-painful solutions would require changing the basebackup protocolso that the source server could adjust the map. That's not veryappetizing either.)
1 parent081876d commita50e4fd

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

‎doc/src/sgml/ref/pg_basebackup.sgml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ PostgreSQL documentation
161161
tablespaces, the main data directory will be placed in the
162162
target directory, but all other tablespaces will be placed
163163
in the same absolute path as they have on the source server.
164+
(See <option>--tablespace-mapping</option> to change that.)
164165
</para>
165166
<para>
166167
This is the default format.
@@ -241,7 +242,12 @@ PostgreSQL documentation
241242
the main data directory are updated to point to the new location. So
242243
the new data directory is ready to be used for a new server instance
243244
with all tablespaces in the updated locations.
244-
</para>
245+
</para>
246+
247+
<para>
248+
Currently, this option only works with plain output format; it is
249+
ignored if tar format is selected.
250+
</para>
245251
</listitem>
246252
</varlistentry>
247253

‎src/backend/access/transam/xlog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11959,7 +11959,7 @@ read_tablespace_map(List **tablespaces)
1195911959
}
1196011960
elseif ((ch=='\n'||ch=='\r')&&prev_ch=='\\')
1196111961
str[i-1]=ch;
11962-
else
11962+
elseif (i<sizeof(str)-1)
1196311963
str[i++]=ch;
1196411964
prev_ch=ch;
1196511965
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp