Uninitialized enum higher bytes when reading as unsigned char fixed
This commit is contained in:
parent
f32d653bb8
commit
f43488be98
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user