Commit 28328ec
committed
Fix overflow danger in SampleHeapTupleVisible()
68d9662 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.com1 parent 68d9662 commit 28328ec
1 file changed
+9
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2577 | 2577 | | |
2578 | 2578 | | |
2579 | 2579 | | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
2580 | 2586 | | |
2581 | 2587 | | |
2582 | 2588 | | |
| |||
2586 | 2592 | | |
2587 | 2593 | | |
2588 | 2594 | | |
2589 | | - | |
2590 | | - | |
| 2595 | + | |
| 2596 | + | |
2591 | 2597 | | |
2592 | 2598 | | |
2593 | 2599 | | |
2594 | | - | |
| 2600 | + | |
2595 | 2601 | | |
2596 | 2602 | | |
2597 | 2603 | | |
| |||
0 commit comments