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
{{ message }}
Repository navigation
ThinVec::<ZST>::insert dereferences the fake length pointer (segfault from safe code) #101
debug: panics with assertion failed: !Self::is_zst() (the debug_assert! in header_mut)
Miri: Undefined Behavior: constructing invalid value of type &mut thin_vec::Header: encountered a dangling reference (0x1[noalloc] has no provenance)
For a vec of length n, the write goes to address n + 1, so it isn't limited to the null page. I ran every other public method on a ZST ThinVec under Miri, and only insert is affected.
Fix: in insert, replace self.set_header_len(old_len + 1) with self.set_len_non_singleton(old_len + 1), as push_unchecked does.
Activity