You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Potential for false positives, but in the past I saw something like:
#[derive(Clone, ...,Deserialize)]pubstructNamespacedName{// `foo/bar` stored togetherinner:Box<str>,// the position of the slash -- constructor ensures it's in boundssplit:usize,}implNamespacedName{#[inline]pubfnparts(&self) -> (&str,&str){unsafe{let ns = self.inner.get_unchecked(..self.split);let name = self.inner.get_unchecked((self.split + 1)..);(ns, name)}}}
Of course, while the constructor did ensure it was in bounds, serde added a second constructor which did not. I suspect other code could have a similar problem.
The text was updated successfully, but these errors were encountered:
flip1995
added
E-medium
Call for participation: Medium difficulty level problem and requires some initial experience.
A-lint
Area: New lints
labels
Apr 15, 2020
Potential for false positives, but in the past I saw something like:
Of course, while the constructor did ensure it was in bounds,
serde
added a second constructor which did not. I suspect other code could have a similar problem.The text was updated successfully, but these errors were encountered: