pgsql: Avoid possible overflow with ltsGetFreeBlock() in logtape.c

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема pgsql: Avoid possible overflow with ltsGetFreeBlock() in logtape.c
Дата
Msg-id E1qb7lS-001aac-2x@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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 c02fdc9223015, 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

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5180160c177466a319981f68895a14ba4d4eb234

Modified Files
--------------
src/backend/utils/sort/logtape.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: noreply@postgresql.org
Дата:
Сообщение: pgsql: Tag refs/tags/REL_16_RC1 was created
Следующее
От: Michael Paquier
Дата:
Сообщение: pgsql: Fix comment of PQputCopyEnd()