]> granicus.if.org Git - postgresql/commitdiff
Add missing "goto err" statements in xlogreader.c.
authorFujii Masao <fujii@postgresql.org>
Mon, 9 Mar 2015 05:31:10 +0000 (14:31 +0900)
committerFujii Masao <fujii@postgresql.org>
Mon, 9 Mar 2015 05:31:10 +0000 (14:31 +0900)
Spotted by Andres Freund.

src/backend/access/transam/xlogreader.c

index 60470b56af7264810d49e3ca5a8cdbbaef6f1d75..5bd07e381d8f7e0fb000bb510947e137bd8105f1 100644 (file)
@@ -1019,14 +1019,20 @@ DecodeXLogRecord(XLogReaderState *state, XLogRecord *record, char **errormsg)
                        COPY_HEADER_FIELD(&blk->data_len, sizeof(uint16));
                        /* cross-check that the HAS_DATA flag is set iff data_length > 0 */
                        if (blk->has_data && blk->data_len == 0)
+                       {
                                report_invalid_record(state,
                                          "BKPBLOCK_HAS_DATA set, but no data included at %X/%X",
                                                                          (uint32) (state->ReadRecPtr >> 32), (uint32) state->ReadRecPtr);
+                               goto err;
+                       }
                        if (!blk->has_data && blk->data_len != 0)
+                       {
                                report_invalid_record(state,
                                 "BKPBLOCK_HAS_DATA not set, but data length is %u at %X/%X",
                                                                          (unsigned int) blk->data_len,
                                                                          (uint32) (state->ReadRecPtr >> 32), (uint32) state->ReadRecPtr);
+                               goto err;
+                       }
                        datatotal += blk->data_len;
 
                        if (blk->has_image)