From a5a84274fe8bcb4d41ee4d3b058132079a9ff020 Mon Sep 17 00:00:00 2001 From: Abraham Egnor Date: Thu, 10 Jun 2021 13:00:13 -0400 Subject: [PATCH] RUST-755 Use zeroed rather than uninitialized memory for decimal128 deserialization (#263) --- src/de/mod.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/de/mod.rs b/src/de/mod.rs index 401dc432..1e87838e 100644 --- a/src/de/mod.rs +++ b/src/de/mod.rs @@ -164,9 +164,7 @@ fn read_f128(reader: &mut R) -> Result { #[cfg(feature = "decimal128")] #[inline] fn read_f128(reader: &mut R) -> Result { - use std::mem; - - let mut local_buf: [u8; 16] = unsafe { mem::MaybeUninit::uninit().assume_init() }; + let mut local_buf = [0u8; 16]; reader.read_exact(&mut local_buf)?; let val = unsafe { Decimal128::from_raw_bytes_le(local_buf) }; Ok(val)