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

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

Michael Paquier
This commit is contained in:
Tom Lane 2016-11-06 11:29:40 -05:00
parent 32416b0f9a
commit 5485c99e7f

View File

@ -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,
} }
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)
{ {