Replies: 3 comments 2 replies
-
|
Oh this should definitely be a Discussion sigh |
Beta Was this translation helpful? Give feedback.
-
|
@saethlin went ahead and converted it to a "Discussion". My personal take is I think it would be good to file informational advisories about usages of |
Beta Was this translation helpful? Give feedback.
-
|
I raised about itoa here - #1404 We could perhaps use the informational = notice here I would love to be able to flag std functions as unsound .. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The standard library has a stern warning against use of
mem::uninitializedthat it sort of walks back at the end:There has been a slow but very broad ecosystem move away from this function. For example,
itoapublished a 1.0 release 2 months ago which removes use of this function.bytesused to use it too, as well ascrossbeam. I've runcargo auditon crates that depend on versions of these crates which callmem::uninitializedand I don't come up with anything foritoa,bytes, orcrossbeam. I've selected these crates specifically to call out, because I know they construct uninit instances ofu8orusizeand I know that pre-patch versions of them are in use.I think it would be fair to indicate to users that they should upgrade, given how long it's been since a patch and that
itoachanged basically not at all with 1.0. But does "constructs uninit integers" meet the bar for a RustSec advisory in light of the fact that it's definitely a bad idea, but unclear if it's UB? It's unclear to my mind if this is the same kind of thing as assuming the layout ofSocketAddr.I made the mistake of mentioning
mem::uninitializedtoo much above. There are also instances whereMaybeUninit::assume_initis called on uninitialized integers, and I think those should be considered in the same category.Beta Was this translation helpful? Give feedback.
All reactions