Uninitialized enum higher bytes when reading as unsigned char fixed
This commit is contained in:
parent
bda31a487f
commit
e7e57abf52
@ -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)
|
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;
|
cursor >> (unsigned char&)val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
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;
|
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)
|
inline void operator>>(_Inout_ eap::cursor_in &cursor, _Out_ winstd::cert_context &val)
|
||||||
{
|
{
|
||||||
DWORD dwCertEncodingType;
|
DWORD dwCertEncodingType;
|
||||||
|
assert(sizeof(dwCertEncodingType) == sizeof(unsigned int));
|
||||||
cursor >> (unsigned int&)dwCertEncodingType;
|
cursor >> (unsigned int&)dwCertEncodingType;
|
||||||
|
|
||||||
DWORD dwCertEncodedSize;
|
DWORD dwCertEncodedSize;
|
||||||
|
assert(sizeof(dwCertEncodingType) == sizeof(unsigned int));
|
||||||
cursor >> (unsigned int&)dwCertEncodedSize;
|
cursor >> (unsigned int&)dwCertEncodedSize;
|
||||||
|
|
||||||
if (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)
|
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;
|
cursor >> (unsigned char&)val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user