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
For now, fixing this soundness issue might have some performance cost (if initializing a buffer) or lead to a less convenient API (if using MaybeUninit). RFC 2930 will provide a better solution once implemented.
What it does
Checks for the creation of uninitialized
Vec<T>
by callingset_len()
immediately afterwith_capacity()
orreserve()
.This is one of the most common unsound bug patterns we observed during Rudra project, e.g., bodoni/truetype#11 (RUSTSEC-2021-0029), uutils/coreutils#1729 (RUSTSEC-2021-0043).
Categories
Drawbacks
For now, fixing this soundness issue might have some performance cost (if initializing a buffer) or lead to a less convenient API (if using
MaybeUninit
). RFC 2930 will provide a better solution once implemented.Example
Use an initialized buffer instead:
Or, the content can be wrapped in
MaybeUninit
:The text was updated successfully, but these errors were encountered: