Skip to content

Possible unsound public APIΒ #5

@charlesxsh

Description

@charlesxsh

This public accessible function can cause memory risk since it does not check the input address, which violates the rules specified in https://doc.rust-lang.org/std/alloc/trait.GlobalAlloc.html.

hugepage-rs/src/lib.rs

Lines 68 to 70 in 403f5de

pub fn dealloc(p: *mut u8, layout: Layout) {
unsafe { HUGEPAGE_ALLOCATOR.dealloc(p, layout) }
}

Suggestion:
Consider to make it unsafe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions