Skip to content

Commit c74c04b

Browse files
committed
Add missing "goto err" statements in xlogreader.c.
Spotted by Andres Freund.
1 parent 5a2a48f commit c74c04b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/access/transam/xlogreader.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,14 +1019,20 @@ DecodeXLogRecord(XLogReaderState *state, XLogRecord *record, char **errormsg)
10191019
COPY_HEADER_FIELD(&blk->data_len, sizeof(uint16));
10201020
/* cross-check that the HAS_DATA flag is set iff data_length > 0 */
10211021
if (blk->has_data && blk->data_len == 0)
1022+
{
10221023
report_invalid_record(state,
10231024
"BKPBLOCK_HAS_DATA set, but no data included at %X/%X",
10241025
(uint32) (state->ReadRecPtr >> 32), (uint32) state->ReadRecPtr);
1026+
goto err;
1027+
}
10251028
if (!blk->has_data && blk->data_len != 0)
1029+
{
10261030
report_invalid_record(state,
10271031
"BKPBLOCK_HAS_DATA not set, but data length is %u at %X/%X",
10281032
(unsigned int) blk->data_len,
10291033
(uint32) (state->ReadRecPtr >> 32), (uint32) state->ReadRecPtr);
1034+
goto err;
1035+
}
10301036
datatotal += blk->data_len;
10311037

10321038
if (blk->has_image)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy