Skip to content

Commit 65d30a6

Browse files
5225225Licenser
authored andcommitted
Use correct input to find structural bits
1 parent b85e280 commit 65d30a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![deny(warnings)]
22
#![cfg_attr(feature = "hints", feature(core_intrinsics))]
3-
#![deny(warnings)]
43
#![warn(unused_extern_crates)]
54
#![deny(
65
clippy::all,
@@ -488,13 +487,14 @@ impl<'de> Deserializer<'de> {
488487
len,
489488
);
490489

491-
input_buffer.as_mut_ptr().add(len).write(0);
490+
let to_fill = input_buffer.capacity() - len;
491+
std::ptr::write_bytes(input_buffer.as_mut_ptr().add(len), 0, to_fill);
492492

493-
input_buffer.set_len(len);
493+
input_buffer.set_len(input_buffer.capacity());
494494
};
495495

496496
let s1_result: std::result::Result<Vec<u32>, ErrorType> =
497-
unsafe { Self::find_structural_bits(input_buffer) };
497+
unsafe { Self::find_structural_bits(input) };
498498

499499
let structural_indexes = match s1_result {
500500
Ok(i) => i,

0 commit comments

Comments
 (0)