Resolve memory corruption because of padding issue
mDefaultSysCodePowerstate eventhough of type uint8_t,
it gets passed as int reference to function
checkAndUpdatePowerState.
This causes overwriting of its value in a region more
than what is actually allocated for it. Results in corrupting
memory of variable declared next to it.
Fix:Do not allow access of more memory than variable
allocated initially whenever passing as reference to another
function(Do not type cast to variable types of higher type).
2 files changed