From: | Daniel Gustafsson <dgustafsson(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix sscanf limits in pg_basebackup and pg_dump |
Date: | 2021-10-19 11:17:27 |
Message-ID: | E1mcn7X-0000Dw-6L@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
Fix sscanf limits in pg_basebackup and pg_dump
Make sure that the string parsing is limited by the size of the
destination buffer.
In pg_basebackup the available values sent from the server
is limited to two characters so there was no risk of overflow.
In pg_dump the buffer is bounded by MAXPGPATH, and thus the limit
must be inserted via preprocessor expansion and the buffer increased
by one to account for the terminator. There is no risk of overflow
here, since in this case, the buffer scanned is smaller than the
destination buffer.
Backpatch the pg_basebackup fix to 11 where it was introduced, and
the pg_dump fix all the way down to 9.6.
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/B14D3D7B-F98C-4E20-9459-C122C67647FB@yesql.se
Backpatch-through: 11 and 9.6
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/1d7641d51a51aa00dff685022fab6c03be8f8af8
Modified Files
--------------
src/bin/pg_basebackup/streamutil.c | 2 +-
src/bin/pg_dump/pg_backup_directory.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Daniel Gustafsson | 2021-10-19 11:18:54 | pgsql: Fix sscanf limits in pg_basebackup and pg_dump |
Previous Message | Michael Paquier | 2021-10-19 02:07:54 | pgsql: Block ALTER INDEX/TABLE index_name ALTER COLUMN colname SET (opt |