Skip to content

fast-able possible unsound public API #2287

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
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions crates/fast-able/RUSTSEC-0000-0000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
```toml
[advisory]
id = "RUSTSEC-0000-0000"
package = "fast-able"
date = "2025-04-25"
categories = ["memory-corruption"]

[versions]
patched = []
unaffected = []
```

# Possible unsound public API

At src/vec.rs:

```rust
impl<V> SyncVec<V>
where
V: Clone,
{
pub fn to_vec(&self) -> Vec<V> {
let mut v = Vec::new();
for i in self.iter() {
v.push(i.clone());
}
v
}
}

impl<V> SyncVec<V> {
...
#[inline]
pub fn get_uncheck(&self, index: usize) -> &V {
unsafe { (&*self.dirty.get()).get_unchecked(index) }
}
```

The public accessible struct SyncVec has a public method get_unchecked. It accept a parameter index and used in the get_unchecked without sufficient checks as mentioned [here](https://doc.rust-lang.org/std/primitive.slice.html#method.get_unchecked). In Rust, safe function should not cause memory risks.