pgsql: Avoid invalid alloc size error in shm_mq - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Avoid invalid alloc size error in shm_mq
Date
Msg-id E1kUuJy-0002EP-KS@gemulon.postgresql.org
Whole thread Raw
List 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
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d27c18d26f00fc13401931fe9deb5012610faf89

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


pgsql-committers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: pgsql: Change the docs for PARALLEL option of Vacuum.
Next
From: Alvaro Herrera
Date:
Subject: pgsql: Fix ALTER TABLE .. ENABLE/DISABLE TRIGGER recursion