postgresql/src/backend/utils/sort
Michael Paquier 52c6c0f196 Avoid possible overflow with ltsGetFreeBlock() in logtape.c
nFreeBlocks, defined as a long, stores the number of free blocks in a
logical tape.  ltsGetFreeBlock() has been using an int to store the
value of nFreeBlocks, which could lead to overflows on platforms where
long and int are not the same size (in short everything except Windows
where long is 4 bytes).

The problematic intermediate variable is switched to be a long instead
of an int.

Issue introduced by c02fdc9223, so backpatch down to 13.

Author: Ranier vilela
Reviewed-by: Peter Geoghegan, David Rowley
Discussion: https://postgr.es/m/CAEudQApLDWCBR_xmwNjGBrDo+f+S4E87x3s7-+hoaKqYdtC4JQ@mail.gmail.com
Backpatch-through: 13
2023-08-30 08:03:42 +09:00
..
logtape.c Avoid possible overflow with ltsGetFreeBlock() in logtape.c 2023-08-30 08:03:42 +09:00
Makefile Split tuplesortvariants.c from tuplesort.c 2022-07-27 08:28:26 +03:00
meson.build Update copyright for 2023 2023-01-02 15:00:37 -05:00
qsort_interruptible.c Invent qsort_interruptible(). 2022-07-12 16:30:36 -04:00
sharedtuplestore.c Allocate hash join files in a separate memory context 2023-05-19 17:17:58 +02:00
sortsupport.c Update copyright for 2023 2023-01-02 15:00:37 -05:00
tuplesort.c Split out tiebreaker comparisons from comparetup_* functions 2023-08-16 17:15:07 +07:00
tuplesortvariants.c Split out tiebreaker comparisons from comparetup_* functions 2023-08-16 17:15:07 +07:00
tuplestore.c Simplify useless 0L constants 2023-03-29 08:25:12 +02:00