Skip to content

Commit

Permalink
MDEV-33052 MSAN use-of-uninitialized-value in buf_read_ahead_linear()
Browse files Browse the repository at this point in the history
buf_read_ahead_linear(): Suppress a warning of comparing potentially
uninitialized FIL_PAGE_PREV and FIL_PAGE_NEXT fields.
  • Loading branch information
dr-m committed Dec 18, 2023
1 parent 4ae105a commit 4c2e971
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions storage/innobase/buf/buf0rea.cc
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,12 @@ buf_read_ahead_linear(const page_id_t page_id, ulint zip_size, bool ibuf)

uint32_t prev= mach_read_from_4(my_assume_aligned<4>(f + FIL_PAGE_PREV));
uint32_t next= mach_read_from_4(my_assume_aligned<4>(f + FIL_PAGE_NEXT));
/* The underlying file page of this buffer pool page could actually
be marked as freed, or a read of the page into the buffer pool might
be in progress. We may read uninitialized data here.
Suppress warnings of comparing uninitialized values. */
MEM_MAKE_DEFINED(&prev, sizeof prev);
MEM_MAKE_DEFINED(&next, sizeof next);
if (prev == FIL_NULL || next == FIL_NULL)
goto hard_fail;
page_id_t id= page_id;
Expand Down

0 comments on commit 4c2e971

Please sign in to comment.