Commit bdf50c3e authored by Marko Mäkelä's avatar Marko Mäkelä

log_group_read_log_seg(): Validate the length

If the LOG_BLOCK_HDR_DATA_LEN field is corrupted, scanning the
log records could fail in strange ways. It is better to validate
the field as part of validating each log block.
parent f30c5af4
......@@ -723,6 +723,15 @@ log_group_read_log_seg(
OS_FILE_LOG_BLOCK_SIZE, true);
}
}
ulint dl = log_block_get_data_len(buf);
if (dl < LOG_BLOCK_HDR_SIZE
|| (dl > OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE
&& dl != OS_FILE_LOG_BLOCK_SIZE)) {
recv_sys->found_corrupt_log = true;
end_lsn = *start_lsn;
break;
}
}
if (recv_sys->report(ut_time())) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment