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
Kani does not flag out-of-bounds dereference with kani::vec::any_vec #2759
Activity
zhassan-aws commentedon Sep 12, 2023
This unsoundness is similar to the one reported in #1009.
arctic-alpaca commentedon Sep 13, 2023
Adding
v.shrink_to(real_length);at https://github.com/model-checking/kani/blob/main/library/kani/src/vec.rs#L15 seems to fix this in my limited testing. I can't run the regression tests locally so I'm not sure whether this affects anything else.arctic-alpaca commentedon Sep 13, 2023
It should actually be possible to remove the unsafe part of
any_vec()by replacingset_len()withtruncate():Current impl:
Proposed impl:
Again only tested with the code from the first post in this issue.
zhassan-aws commentedon Sep 13, 2023
Thanks @arctic-alpaca. The diff that I was going to propose is doing exactly that: