pgsql: Protect against XLogReaderAllocate() failing to allocate memory.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Protect against XLogReaderAllocate() failing to allocate memory.
Date: 2015-01-08 12:39:08
Message-ID: E1Y9CMm-0004mL-4j@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Protect against XLogReaderAllocate() failing to allocate memory.

logical.c's StartupDecodingContext() forgot to check whether
XLogReaderAllocate() returns NULL indicating a memory allocation
failure. This could lead, although quite unlikely, lead to a NULL
pointer dereference.

This only applies to 9.4 as earlier versions don't do logical
decoding, and later versions don't return NULL after allocation
failures in XLogReaderAllocate().

Michael Paquier, with minor changes by me.

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/ed5b0f79512aa37fc92d2097bc9a0b93a27eaee2

Modified Files
--------------
src/backend/replication/logical/logical.c | 5 +++++
1 file changed, 5 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Stephen Frost 2015-01-08 19:18:15 pgsql: Move rowsecurity event trigger test
Previous Message Andres Freund 2015-01-08 12:18:00 pgsql: Fix logging of pages skipped due to pins during vacuum.