Uninitialized enum higher bytes when reading as unsigned char fixed

This commit is contained in:
2017-02-09 11:38:57 +01:00
parent bda31a487f
commit e7e57abf52
3 changed files with 5 additions and 0 deletions

View File

@@ -510,6 +510,7 @@ inline size_t pksizeof(_In_ const eap::config_method::status_t &val)
///
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ eap::config_method::status_t &val)
{
val = (eap::config_method::status_t)0; // Reset higher bytes to zero before reading to lower byte.
cursor >> (unsigned char&)val;
}