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 <[email protected]>
Discussion: 
https://postgr.es/m/tybp286mb0351b057b101c90d7c1239e6b4...@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(-)

Reply via email to