pgsql: Fix overflow danger in SampleHeapTupleVisible() - Mailing list pgsql-committers

From Melanie Plageman
Subject pgsql: Fix overflow danger in SampleHeapTupleVisible()
Date
Msg-id E1tO3IG-000GGi-An@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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(-)


pgsql-committers by date:

Previous
From: Melanie Plageman
Date:
Subject: Re: pgsql: seg: pure parser and reentrant scanner
Next
From: Melanie Plageman
Date:
Subject: pgsql: Add common interface for TBMIterators