Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark find function as unsafe #2

Open
kitcatier opened this issue Mar 17, 2023 · 0 comments
Open

Mark find function as unsafe #2

kitcatier opened this issue Mar 17, 2023 · 0 comments

Comments

@kitcatier
Copy link

Hello, I found a soundness issue in this crate.

pub fn find<T>(l: &LinkedList<T>, k: usize) -> Option<NonNull<Node<T>>> {
unsafe { do_find(l.head, k) }
}

The unsafe function called do_find() needs to meet the corresponding safety requirements of the parameters, and the developer who calls the find() function may not notice this safety requirement.
Marking them unsafe also means that callers must make sure they know what they're doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant