Skip to content

Commit a5a8427

Browse files
abr-egnpatrickfreed
authored andcommitted
RUST-755 Use zeroed rather than uninitialized memory for decimal128 deserialization (#263)
1 parent 406fc80 commit a5a8427

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/de/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ fn read_f128<R: Read + ?Sized>(reader: &mut R) -> Result<Decimal128> {
164164
#[cfg(feature = "decimal128")]
165165
#[inline]
166166
fn read_f128<R: Read + ?Sized>(reader: &mut R) -> Result<Decimal128> {
167-
use std::mem;
168-
169-
let mut local_buf: [u8; 16] = unsafe { mem::MaybeUninit::uninit().assume_init() };
167+
let mut local_buf = [0u8; 16];
170168
reader.read_exact(&mut local_buf)?;
171169
let val = unsafe { Decimal128::from_raw_bytes_le(local_buf) };
172170
Ok(val)

0 commit comments

Comments
 (0)