mirror of
https://github.com/azalea-rs/simdnbt.git
synced 2025-08-02 07:26:04 +00:00
fix an out of bounds write
This commit is contained in:
parent
9d4f1ec4c2
commit
31be4d3231
1 changed files with 1 additions and 2 deletions
|
@ -316,11 +316,10 @@ impl ParsingStack {
|
|||
|
||||
#[inline]
|
||||
pub fn push(&mut self, state: ParsingStackElement) -> Result<(), Error> {
|
||||
// self.stack[self.depth] = MaybeUninit::new(state);
|
||||
unsafe { self.stack.get_unchecked_mut(self.depth).write(state) };
|
||||
self.depth += 1;
|
||||
|
||||
if self.depth > MAX_DEPTH {
|
||||
if self.depth >= MAX_DEPTH {
|
||||
Err(Error::MaxDepthExceeded)
|
||||
} else {
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Reference in a new issue