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

Unsoundness in src/vec.rs/to_str and maybe unmaintained #7

Open
lwz23 opened this issue Nov 12, 2024 · 1 comment
Open

Unsoundness in src/vec.rs/to_str and maybe unmaintained #7

lwz23 opened this issue Nov 12, 2024 · 1 comment

Comments

@lwz23
Copy link

lwz23 commented Nov 12, 2024

I think there is a unsound problem in src/vec.rs/to_str https://github.com/NVSL/Corundum/blob/1685af69d9b34d6d2c918c69c3327023ac753f03/src/vec.rs#L1282,

impl<A: MemPool> Vec<u8, A> {
    pub fn to_str(&self) -> &str {
        unsafe { std::str::from_utf8_unchecked(self.as_slice()) }
    }
}

it direct called the "from_utf8_unchecked" without any precondition and the method is declear as 'pub' and not marked as 'unsafe'. But I can't build this project in my current platform. Is this crate unmaintained?

@lwz23
Copy link
Author

lwz23 commented Nov 12, 2024

If the crate is no longer maintained, I may report the problem to RustSec. I will wait a week before reporting, and if no one replies to me, I will report it to RustSec :)

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