pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Melanie Plageman <melanieplageman@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix overflow danger in SampleHeapTupleVisible()
Date: Wed, 18 Dec 2024 23:17:28 +0000
Message-ID: <E1tO3IG-000GGi-An@gemulon.postgresql.org> (raw)

Fix overflow danger in SampleHeapTupleVisible()

68d9662be1c4b70 made HeapScanDesc->rs_ntuples unsigned but neglected to
change how it was being used in SampleHeapTupleVisible().

Return early if rs_ntuples is 0 to avoid overflowing and incorrectly
executing the loop code in SampleHeapTupleVisible().

Reported-by: Ranier Vilela
Discussion: https://postgr.es/m/CAEudQAot_xQoZyPZjpj1aBUPrPykY5mOPHGyvfe%3Djz%2BWowdA3A%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/28328ec87b45725f62bed1104d99c8b3220d1675

Modified Files
--------------
src/backend/access/heap/heapam_handler.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1tO3IG-000GGi-An@gemulon.postgresql.org>
Permalink:  ../E1tO3IG-000GGi-An@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1tO3IG-000GGi-An@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: melanieplageman@gmail.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix overflow danger in SampleHeapTupleVisible()
  In-Reply-To: <E1tO3IG-000GGi-An@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