handle oob heap index calculation

This commit is contained in:
Skgland
2025-12-07 21:45:13 +01:00
committed by Bennet Bleßmann
parent d63b0a192c
commit 11901b5fde
2 changed files with 14 additions and 8 deletions

View File

@@ -623,7 +623,7 @@ impl Heap {
pub fn reserve(&mut self, num_cells: usize) -> Result<HeapWriter<'_>, AllocError> {
let section;
let len = heap_index!(num_cells);
let len = heap_index_checked!(num_cells).ok_or(AllocError)?;
loop {
unsafe {