NVSL / Corundum

A Rust library for safely programming persistent memory
74 stars 6 forks source link

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

Open lwz23 opened 6 days ago

lwz23 commented 6 days ago

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 commented 6 days ago

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 :)