How does Memory Validator detect uninitialised memory?
Memory Validator detects uninitialised memory in memory allocated by the debug C runtime heap. The debug C runtime heap initialises all allocated memory with a signature byte of 0xCD. It also initialises any uninitialised stack variables with a signature byte of 0xCC. Memory Validator hooks all constructors of C++ objects and at the end of the constructor examines the object for any uninitialised data bytes. If any are found they are reported to the user. 0xCD is a valid value for a data byte but is unusual to be found as a WORD as 0xCDCD or a DWORD as 0xCDCDCDCD. 0xCC is a valid value for a data byte but is unusual to be found as a WORD as 0xCCCC or a DWORD as 0xCCCCCCCC. It is up to the user to determine if the report of uninitialised data is correct or not. The technology for hooking the object’s constructors is the same as is used to hook COM objects.