-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
impl EndpointBuffer {
pub fn new(offset: usize, size: usize) -> Self {
let addr = unsafe { EP_MEM_PTR.add(offset) };
let mem = unsafe { slice::from_raw_parts_mut(addr, size) };
Self(mem)
}
}
In public accessible function EndpointBuffer::new
, it accepts parameters offset and size and used in pointer calculation and slice creation but lack of sufficient checks, which might cause memory issues. In Rust, we should not cause any memory issues if merely using safe functions.
Metadata
Metadata
Assignees
Labels
No labels