pgsql: Avoid invalid alloc size error in shm_mq

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема pgsql: Avoid invalid alloc size error in shm_mq
Дата
Msg-id E1kUuJy-0002EF-IJ@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Avoid invalid alloc size error in shm_mq

In shm_mq_receive(), a huge payload could trigger an unjustified
"invalid memory alloc request size" error due to the way the buffer
size is increased.

Add error checks (documenting the upper limit) and avoid the error by
limiting the allocation size to MaxAllocSize.

Author: Markus Wanner <markus.wanner@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/3bb363e7-ac04-0ac4-9fe8-db1148755bfa%402ndquadrant.com

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/1f53d0b9f45521a85e85b6dcab7c15a7d8b4b973

Modified Files
--------------
src/backend/storage/ipc/shm_mq.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)


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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: pgsql: Change the docs for PARALLEL option of Vacuum.
Следующее
От: Alvaro Herrera
Дата:
Сообщение: pgsql: Fix ALTER TABLE .. ENABLE/DISABLE TRIGGER recursion