Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commited5b0f7

Browse files
committed
Protect against XLogReaderAllocate() failing to allocate memory.
logical.c's StartupDecodingContext() forgot to check whetherXLogReaderAllocate() returns NULL indicating a memory allocationfailure. This could lead, although quite unlikely, lead to a NULLpointer dereference.This only applies to 9.4 as earlier versions don't do logicaldecoding, and later versions don't return NULL after allocationfailures in XLogReaderAllocate().Michael Paquier, with minor changes by me.
1 parent83fb1ca commited5b0f7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎src/backend/replication/logical/logical.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ StartupDecodingContext(List *output_plugin_options,
162162
ctx->slot=slot;
163163

164164
ctx->reader=XLogReaderAllocate(read_page,ctx);
165+
if (!ctx->reader)
166+
ereport(ERROR,
167+
(errcode(ERRCODE_OUT_OF_MEMORY),
168+
errmsg("out of memory")));
169+
165170
ctx->reader->private_data=ctx;
166171

167172
ctx->reorder=ReorderBufferAllocate();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp