Is there any C warning for memcmp(a, b, sizeof(type)) if either *a and *b are not of the type (or if struct doesn't start with type, etc)?
-
-
I continue to be terrified of bugs relating to uninitialized padding and struct uninitialized padding copied between security boundaries
-
This is a strong argument for not copying structs at all but just assigning individual members.
-
struct foo a = b; struct foo a = { 0 }; a.baz = b.baz; a.qux = b.qux; Much more boilerplate. :/
-
Does { 0 } promise to initialize padding to 0? Or do I need memset for that?
-
I would like a hardening mode where the compiler forces all struct padding to be zero. Concerned about leaking stack cookie, for instance.
-
Well stack cookie should be erased *before* the memory can be reused.
-
Right that is an obvious thing to do, I should have checked the stack check assembly. Still concerned about similar leaks.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.