mirror of https://github.com/acidanthera/audk.git
FatPkg/FatPei: Check array offset before use
Move the range check before array access to enforce the bounds as expected. Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
parent
7f5e75895b
commit
3ce5f2d445
|
@ -459,7 +459,7 @@ GetRecoveryCapsuleInfo (
|
|||
// Find corresponding physical block device
|
||||
//
|
||||
BlockDeviceNo = PrivateData->Volume[Index].BlockDeviceNo;
|
||||
while (PrivateData->BlockDevice[BlockDeviceNo].Logical && BlockDeviceNo < PrivateData->BlockDeviceCount) {
|
||||
while (BlockDeviceNo < PrivateData->BlockDeviceCount && PrivateData->BlockDevice[BlockDeviceNo].Logical) {
|
||||
BlockDeviceNo = PrivateData->BlockDevice[BlockDeviceNo].ParentDevNo;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue