Fix overflow danger in SampleHeapTupleVisible(), take 2

Melanie Plageman <melanieplageman@gmail.com>

Commit: 94bb6c4410d81ccc019bb60d8aedb73dbc85df76
Author: Melanie Plageman <melanieplageman@gmail.com>
Date: 2024-12-20T14:43:44Z
Releases: 18.0
Fix overflow danger in SampleHeapTupleVisible(), take 2

28328ec87b45725 addressed one overflow danger in
SampleHeapTupleVisible() but introduced another, albeit a less likely
one. Modify the binary search code to remove this danger.

Reported-by: Richard Guo
Reviewed-by: Richard Guo, Ranier Vilela
Discussion: https://postgr.es/m/CAMbWs4_bE%2BNscChbKWzw6HZOipCUyXfA5133qvoXQ654D3B2gQ%40mail.gmail.com

Files

PathChange+/−
src/backend/access/heap/heapam_handler.c modified +5 −11

Discussion