diff --git a/lib/EAPBase/include/Config.h b/lib/EAPBase/include/Config.h index 673c02b..deb509b 100644 --- a/lib/EAPBase/include/Config.h +++ b/lib/EAPBase/include/Config.h @@ -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; } diff --git a/lib/EAPBase/include/Credentials.h b/lib/EAPBase/include/Credentials.h index b08b036..7ba4a89 100644 --- a/lib/EAPBase/include/Credentials.h +++ b/lib/EAPBase/include/Credentials.h @@ -571,6 +571,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; } diff --git a/lib/EAPBase/include/EAP.h b/lib/EAPBase/include/EAP.h index 8256201..539e1c1 100644 --- a/lib/EAPBase/include/EAP.h +++ b/lib/EAPBase/include/EAP.h @@ -1153,9 +1153,11 @@ inline size_t pksizeof(_In_ const winstd::cert_context &val) inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ winstd::cert_context &val) { DWORD dwCertEncodingType; + assert(sizeof(dwCertEncodingType) == sizeof(unsigned int)); cursor >> (unsigned int&)dwCertEncodingType; DWORD dwCertEncodedSize; + assert(sizeof(dwCertEncodingType) == sizeof(unsigned int)); cursor >> (unsigned int&)dwCertEncodedSize; if (dwCertEncodedSize) { @@ -1182,6 +1184,7 @@ inline size_t pksizeof(_In_ const winstd::eap_type_t &val) inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ winstd::eap_type_t &val) { + val = (winstd::eap_type_t)0; // Reset higher bytes to zero before reading to lower byte. cursor >> (unsigned char&)val; }