Skip to content

Potential unsound public API #40

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

Open
charlesxsh opened this issue Apr 24, 2025 · 2 comments
Open

Potential unsound public API #40

charlesxsh opened this issue Apr 24, 2025 · 2 comments

Comments

@charlesxsh
Copy link

Except the issues mentioned at #37,
At src/common.rs:76

    pub fn check_len(&self, n: usize) -> bool {
        unsafe { self.ptr.add(n) <= self.end }
    }

The index does have appropriate check and passed into pointer's add, which violates the safety requirements mentioned in document

Suggestion:

  1. use self.end minus self.ptr frist
@Alexhuszagh
Copy link
Contributor

This crate unfortunately is unmaintained right now and these issues are documented extensively in the RUSTSEC advisory
https://rustsec.org/advisories/RUSTSEC-2024-0379.html

Hopefully a new version will be published.

@charlesxsh
Copy link
Author

Thanks for the confirm and reply! I found thoese issues during the tool scanning as well and simply make a note for another issue not mentioned in the discussion.

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

2 participants