Skip to content

Commit bef947b

Browse files
committed
MDEV-18902 Uninitialized variable in recv_parse_log_recs()
recv_parse_log_recs(): Do not compare type if ptr==end_ptr (we have reached the end of the redo log parsing buffer), because it will not have been correctly initialized in that case.
1 parent e070cfe commit bef947b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

storage/innobase/log/log0recv.cc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2697,16 +2697,20 @@ bool recv_parse_log_recs(lsn_t checkpoint_lsn, store_t store, bool apply)
26972697
&type, ptr, end_ptr, &space, &page_no,
26982698
false, &body);
26992699

2700-
if (recv_sys->found_corrupt_log
2701-
|| type == MLOG_CHECKPOINT
2702-
|| (ptr != end_ptr
2703-
&& (*ptr & MLOG_SINGLE_REC_FLAG))) {
2704-
recv_sys->found_corrupt_log = true;
2700+
if (recv_sys->found_corrupt_log) {
2701+
corrupted_log:
27052702
recv_report_corrupt_log(
27062703
ptr, type, space, page_no);
27072704
return(true);
27082705
}
27092706

2707+
if (ptr == end_ptr) {
2708+
} else if (type == MLOG_CHECKPOINT
2709+
|| (*ptr & MLOG_SINGLE_REC_FLAG)) {
2710+
recv_sys->found_corrupt_log = true;
2711+
goto corrupted_log;
2712+
}
2713+
27102714
if (recv_sys->found_corrupt_fs) {
27112715
return(true);
27122716
}

0 commit comments

Comments
 (0)