Commit 5485c99e authored by Tom Lane's avatar Tom Lane

Fix silly nil-pointer-dereference bug introduced in commit d5f6f13f.

Don't fetch record->xl_info before we've verified that record isn't
NULL.  Per Coverity.

Michael Paquier
parent 32416b0f
...@@ -7812,7 +7812,6 @@ ReadCheckpointRecord(XLogReaderState *xlogreader, XLogRecPtr RecPtr, ...@@ -7812,7 +7812,6 @@ ReadCheckpointRecord(XLogReaderState *xlogreader, XLogRecPtr RecPtr,
} }
record = ReadRecord(xlogreader, RecPtr, LOG, true); record = ReadRecord(xlogreader, RecPtr, LOG, true);
info = record->xl_info & ~XLR_INFO_MASK;
if (record == NULL) if (record == NULL)
{ {
...@@ -7855,6 +7854,7 @@ ReadCheckpointRecord(XLogReaderState *xlogreader, XLogRecPtr RecPtr, ...@@ -7855,6 +7854,7 @@ ReadCheckpointRecord(XLogReaderState *xlogreader, XLogRecPtr RecPtr,
} }
return NULL; return NULL;
} }
info = record->xl_info & ~XLR_INFO_MASK;
if (info != XLOG_CHECKPOINT_SHUTDOWN && if (info != XLOG_CHECKPOINT_SHUTDOWN &&
info != XLOG_CHECKPOINT_ONLINE) info != XLOG_CHECKPOINT_ONLINE)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment