Uninitialized enum higher bytes when reading as unsigned char fixed

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

View File

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