Skip to content

Commit 5b6f3ae

Browse files
bors[bot]rursprung
andauthored
Merge #57
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 <[email protected]>
2 parents aa48d77 + c9f32c2 commit 5b6f3ae

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ cortex-m = "0.7.2"
2626

2727
[dependencies.linked_list_allocator]
2828
default-features = false
29-
version = "0.8.11"
29+
version = "0.10.4"
3030
features = ["const_mut_refs"]
3131

3232
[dev-dependencies]

src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ impl CortexMHeap {
5555
/// - `size > 0`
5656
pub unsafe fn init(&self, start_addr: usize, size: usize) {
5757
cortex_m::interrupt::free(|cs| {
58-
self.heap.borrow(cs).borrow_mut().init(start_addr, size);
58+
self.heap
59+
.borrow(cs)
60+
.borrow_mut()
61+
.init(start_addr as *mut u8, size);
5962
});
6063
}
6164

0 commit comments

Comments
 (0)