From dfc77b035068e8f4135d137371edbadb6b0b0f2e Mon Sep 17 00:00:00 2001 From: Bob Peterson Date: Mon, 13 Oct 2025 13:53:07 -0500 Subject: [PATCH] Non-Unix arena: use zeroed alloc to avoid UB Reads to the arena were flagged by Miri as UB since it contained uninitialized memory --- core/storage/buffer_pool.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/storage/buffer_pool.rs b/core/storage/buffer_pool.rs index 106c9bc8c..a38e878a8 100644 --- a/core/storage/buffer_pool.rs +++ b/core/storage/buffer_pool.rs @@ -467,7 +467,7 @@ mod arena { mod arena { pub fn alloc(len: usize) -> *mut u8 { let layout = std::alloc::Layout::from_size_align(len, std::mem::size_of::()).unwrap(); - unsafe { std::alloc::alloc(layout) } + unsafe { std::alloc::alloc_zeroed(layout) } } pub fn dealloc(ptr: *mut u8, len: usize) { let layout = std::alloc::Layout::from_size_align(len, std::mem::size_of::()).unwrap();