Skip to content

Commit

Permalink
Merge #57
Browse files Browse the repository at this point in the history
57: update `linked_list_allocator` to `0.10.4` r=adamgreig a=rursprung

versions <= 0.10.1 were affected by [CVE-2022-36086][].
note that with 0.10.0 a breaking API change was done which changed the signature of `init`. this can however be avoided simply by casting back (to avoid a breaking API change in `alloc-cortex-m` by changing the API here as well - if wished, this should be done as a separate step).

i've also tried to instead switch to the `init_from_slice` API (introduced in 0.9.1), however I've failed at getting this to compile due to lifetimes (i'm sure it's somehow possible and i just missed the obvious...), but that'd anyway have been a breaking change for `alloc-cortex-m` and, if done, should be done in a separate step (though it'd definitely clean the API up and make it nicer!).

[CVE-2022-36086]: GHSA-xg8p-34w2-j49j

Co-authored-by: Ralph Ursprung <ralph.ursprung@gmail.com>
  • Loading branch information
bors[bot] and rursprung committed Nov 3, 2022
2 parents aa48d77 + c9f32c2 commit 5b6f3ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cortex-m = "0.7.2"

[dependencies.linked_list_allocator]
default-features = false
version = "0.8.11"
version = "0.10.4"
features = ["const_mut_refs"]

[dev-dependencies]
Expand Down
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ impl CortexMHeap {
/// - `size > 0`
pub unsafe fn init(&self, start_addr: usize, size: usize) {
cortex_m::interrupt::free(|cs| {
self.heap.borrow(cs).borrow_mut().init(start_addr, size);
self.heap
.borrow(cs)
.borrow_mut()
.init(start_addr as *mut u8, size);
});
}

Expand Down

0 comments on commit 5b6f3ae

Please sign in to comment.