Reviewed-by: Michael D Kinney <michael.d.kin...@intel.com> > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Michael > Kubacki > Sent: Tuesday, December 12, 2023 11:24 AM > To: devel@edk2.groups.io > Cc: Ni, Ray <ray...@intel.com> > Subject: [edk2-devel] [PATCH v1 1/1] FatPkg/FatPei: Check array offset > before use > > From: Michael Kubacki <michael.kuba...@microsoft.com> > > Move the range check before array access to enforce the bounds > as expected. > > Cc: Ray Ni <ray...@intel.com> > Signed-off-by: Michael Kubacki <michael.kuba...@microsoft.com> > --- > FatPkg/FatPei/FatLiteApi.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/FatPkg/FatPei/FatLiteApi.c b/FatPkg/FatPei/FatLiteApi.c > index cc48c4c66b7b..b89ab7009da0 100644 > --- a/FatPkg/FatPei/FatLiteApi.c > +++ b/FatPkg/FatPei/FatLiteApi.c > @@ -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; > } > > -- > 2.43.0.windows.1 > > > > -=-=-=-=-=-= > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#112453): > https://edk2.groups.io/g/devel/message/112453 > Mute This Topic: https://groups.io/mt/103136267/1643496 > Group Owner: devel+ow...@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub > [michael.d.kin...@intel.com] > -=-=-=-=-=-= >
-=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112460): https://edk2.groups.io/g/devel/message/112460 Mute This Topic: https://groups.io/mt/103136267/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-