]> granicus.if.org Git - postgresql/commit
Protect against XLogReaderAllocate() failing to allocate memory.
authorAndres Freund <andres@anarazel.de>
Thu, 8 Jan 2015 12:35:04 +0000 (13:35 +0100)
committerAndres Freund <andres@anarazel.de>
Thu, 8 Jan 2015 12:35:04 +0000 (13:35 +0100)
commited5b0f79512aa37fc92d2097bc9a0b93a27eaee2
tree62b80d361d04c673f55dd759394a269c2cab413c
parent83fb1ca5cf393f3a12930bd9275a711cd858c823
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.
src/backend/replication/logical/logical.c