pgsql: Tighten overflow checks in tidin().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Tighten overflow checks in tidin().
Date: 2022-03-04 01:04:44
Message-ID: E1nPwNA-000nj5-1Z@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Tighten overflow checks in tidin().

This code seems to have been written on the assumption that
"unsigned long" is 32 bits; or at any rate it ignored the
possibility of conversion overflow. Rewrite, borrowing some
logic from oidin().

Discussion: https://postgr.es/m/3441768.1646343914@sss.pgh.pa.us

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/tid.c | 28 +++++++++++++++++++++-------
src/test/regress/expected/tid.out | 19 +++++++++++++++++++
src/test/regress/sql/tid.sql | 12 ++++++++++++
3 files changed, 52 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2022-03-04 02:35:53 pgsql: Add some additional tests for row filters in logical replication
Previous Message Michael Paquier 2022-03-04 00:53:50 Re: pgsql: Fix catalog data of pg_stop_backup(), labelled v2