Fix potential bugs found with static analysis

This commit is contained in:
vit9696 2019-03-26 14:22:51 +03:00
parent 2cbd78fb9e
commit 5edd5c10ee
4 changed files with 16 additions and 10 deletions

View file

@ -46,7 +46,9 @@ VOID uint32ToUint24(UINT32 size, UINT8* ffsSize)
UINT32 uint24ToUint32(const UINT8* ffsSize)
{
return readUnaligned((UINT32*)ffsSize) & 0x00FFFFFF;
return (UINT32) ffsSize[0]
+ ((UINT32) ffsSize[1] << 8U)
+ ((UINT32) ffsSize[2] << 16U);
}
UString guidToUString(const EFI_GUID & guid, bool convertToString)