Skip to content
Permalink
Browse files
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.
  • Loading branch information
dr-m committed Aug 9, 2018
1 parent f30c5af commit bdf50c3
Showing 1 changed file with 9 additions and 0 deletions.
@@ -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())) {

0 comments on commit bdf50c3

Please sign in to comment.