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.
This commit is contained in:
Marko Mäkelä 2019-03-12 14:03:10 +02:00
commit bef947b4c9

View file

@ -2697,16 +2697,20 @@ loop:
&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);
}