pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid overflow in fe_utils' printTable()
Date: Tue, 21 Nov 2023 14:01:01 +0000
Message-ID: <E1r5RJF-006Wty-2W@gemulon.postgresql.org> (raw)

Avoid overflow in fe_utils' printTable()

The original code would miscalculate the total number of cells when the
table to print has more than ~4 billion cells, leading to an unnecessary
error.  Repair by changing some computations to be 64-bits wide.  Add
some necessary overflow checks.

Author: Hongxu Ma <interma@outlook.com>
Discussion: https://postgr.es/m/TYBP286MB0351B057B101C90D7C1239E6B4E2A@TYBP286MB0351.JPNP286.PROD.OUTLOOK.COM

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/24ea53dcfab7fe463c0cf56095e9fe5d23cdb748

Modified Files
--------------
src/fe_utils/print.c         | 30 ++++++++++++++++++++++--------
src/include/fe_utils/print.h |  2 +-
2 files changed, 23 insertions(+), 9 deletions(-)



Message-ID: <E1r5RJF-006Wty-2W@gemulon.postgresql.org>
Permalink:  ../E1r5RJF-006Wty-2W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1r5RJF-006Wty-2W@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid overflow in fe_utils' printTable()
  In-Reply-To: <E1r5RJF-006Wty-2W@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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