Add assertion to ensure the boolean value must be 0 or 1 before the use of array index

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9602 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qhuang8 2009-12-25 04:28:31 +00:00
parent f335832963
commit 61d4f8f92a
1 changed files with 2 additions and 1 deletions

View File

@ -409,8 +409,9 @@ TransferAtaDevice (
EFI_ATA_PASS_THRU_COMMAND_PACKET *Packet;
//
// Ensure AtaDevice->Lba48Bit and IsWrite are valid boolean values
// Ensure AtaDevice->UdmaValid, AtaDevice->Lba48Bit and IsWrite are valid boolean values
//
ASSERT ((UINTN) AtaDevice->UdmaValid < 2);
ASSERT ((UINTN) AtaDevice->Lba48Bit < 2);
ASSERT ((UINTN) IsWrite < 2);
//