"{0} initializer in C or C++ for unions no longer guarantees clearing of the whole union (except for static storage duration initialization)"
WHAT?!?!
This language.. I swear...
"{0} initializer in C or C++ for unions no longer guarantees clearing of the whole union (except for static storage duration initialization)"
WHAT?!?!
This language.. I swear...
@federicomena I'd be curious if there have been any MRs/PRs/patch submissions recently, where somebody just "reordered" unions fields in sec relevant software where it just happens the first member is now the smallest one leading to this situation 🙃
@karolherbst to be fair, I haven't checked if "let rust_enum = MyEnum::Something(blah)" zeros out the rest of the space in the enum. I guess the considerations there are different because the language won't let you access variants that are not valid, while in C "memset everything to 0" is pretty much a requirement to prevent fuckups.
@federicomena Well.. reads of C style unions in rust is unsafe at least.
@karolherbst info disclosure CVE in 3... 2... 1...