pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix sscanf limits in pg_basebackup and pg_dump
5+ messages / 1 participants
[nested] [flat]

* pgsql: Fix sscanf limits in pg_basebackup and pg_dump
@ 2021-10-19 11:17  Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Daniel Gustafsson @ 2021-10-19 11:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix sscanf limits in pg_basebackup and pg_dump
@ 2021-10-19 11:18  Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Daniel Gustafsson @ 2021-10-19 11:18 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/121be6a665aaf64e0fe45b424cd26b53b384dc31

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(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix sscanf limits in pg_basebackup and pg_dump
@ 2021-10-19 11:19  Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Daniel Gustafsson @ 2021-10-19 11:19 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d3a4c1eb3d2188e8df58b4f2837cd17acc8629e1

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(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix sscanf limits in pg_basebackup and pg_dump
@ 2021-10-19 11:20  Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Daniel Gustafsson @ 2021-10-19 11:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/57bf8f7b75ec3f1509175006ccf3c139c0d1adc8

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(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix sscanf limits in pg_basebackup and pg_dump
@ 2021-10-19 11:20  Daniel Gustafsson <dgustafsson@postgresql.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Daniel Gustafsson @ 2021-10-19 11:20 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/931f3926a9f69e8de4a673b05b8e7a1fffc1d0d9

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(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2021-10-19 11:20 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-10-19 11:17 pgsql: Fix sscanf limits in pg_basebackup and pg_dump Daniel Gustafsson <dgustafsson@postgresql.org>
2021-10-19 11:18 pgsql: Fix sscanf limits in pg_basebackup and pg_dump Daniel Gustafsson <dgustafsson@postgresql.org>
2021-10-19 11:19 pgsql: Fix sscanf limits in pg_basebackup and pg_dump Daniel Gustafsson <dgustafsson@postgresql.org>
2021-10-19 11:20 pgsql: Fix sscanf limits in pg_basebackup and pg_dump Daniel Gustafsson <dgustafsson@postgresql.org>
2021-10-19 11:20 pgsql: Fix sscanf limits in pg_basebackup and pg_dump Daniel Gustafsson <dgustafsson@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox