Skip to content

Commit a9eba30

Browse files
authored
RUST-755 Use zeroed rather than uninitialized memory for decimal128 deserialization (#263)
1 parent fcc7040 commit a9eba30

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/de/mod.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,7 @@ fn read_f128<R: Read + ?Sized>(reader: &mut R) -> Result<Decimal128> {
159159
#[cfg(feature = "decimal128")]
160160
#[inline]
161161
fn read_f128<R: Read + ?Sized>(reader: &mut R) -> Result<Decimal128> {
162-
use std::mem;
163-
164-
let mut local_buf: [u8; 16] = unsafe { mem::MaybeUninit::uninit().assume_init() };
162+
let mut local_buf = [0u8; 16];
165163
reader.read_exact(&mut local_buf)?;
166164
let val = unsafe { Decimal128::from_raw_bytes_le(local_buf) };
167165
Ok(val)

0 commit comments

Comments
 (0)