Skip to content
Permalink
Browse files
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.
  • Loading branch information
dr-m committed Mar 12, 2019
1 parent e070cfe commit bef947b
Showing 1 changed file with 9 additions and 5 deletions.
@@ -2697,16 +2697,20 @@ bool recv_parse_log_recs(lsn_t checkpoint_lsn, store_t store, bool apply)
&type, ptr, end_ptr, &space, &page_no,
false, &body);

if (recv_sys->found_corrupt_log
|| type == MLOG_CHECKPOINT
|| (ptr != end_ptr
&& (*ptr & MLOG_SINGLE_REC_FLAG))) {
recv_sys->found_corrupt_log = true;
if (recv_sys->found_corrupt_log) {
corrupted_log:
recv_report_corrupt_log(
ptr, type, space, page_no);
return(true);
}

if (ptr == end_ptr) {
} else if (type == MLOG_CHECKPOINT
|| (*ptr & MLOG_SINGLE_REC_FLAG)) {
recv_sys->found_corrupt_log = true;
goto corrupted_log;
}

if (recv_sys->found_corrupt_fs) {
return(true);
}

0 comments on commit bef947b

Please sign in to comment.