mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/Bus/Usb/UsbNetwork: Check array index range before access
Checks that an offset used to access array elements is within the expected range before accessing the array item. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Ray Ni <ray.ni@intel.com> Cc: Rebecca Cran <rebecca@bsdio.com> Cc: Richard Ho <richardho@ami.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
parent
68238d4f94
commit
1f161a7915
|
@ -769,7 +769,7 @@ ConvertFilter (
|
|||
|
||||
Count = sizeof (gTable)/sizeof (gTable[0]);
|
||||
|
||||
for (Index = 0; (gTable[Index].Src != 0) && (Index < Count); Index++) {
|
||||
for (Index = 0; (Index < Count) && (gTable[Index].Src != 0); Index++) {
|
||||
if (gTable[Index].Src & Value) {
|
||||
*CdcFilter |= gTable[Index].Dst;
|
||||
}
|
||||
|
|
|
@ -855,7 +855,7 @@ ConvertFilter (
|
|||
|
||||
Count = sizeof (gTable)/sizeof (gTable[0]);
|
||||
|
||||
for (Index = 0; (gTable[Index].Src != 0) && (Index < Count); Index++) {
|
||||
for (Index = 0; (Index < Count) && (gTable[Index].Src != 0); Index++) {
|
||||
if (gTable[Index].Src & Value) {
|
||||
*CdcFilter |= gTable[Index].Dst;
|
||||
}
|
||||
|
|
|
@ -803,7 +803,7 @@ ConvertFilter (
|
|||
|
||||
Count = sizeof (gTable)/sizeof (gTable[0]);
|
||||
|
||||
for (Index = 0; (gTable[Index].Src != 0) && (Index < Count); Index++) {
|
||||
for (Index = 0; (Index < Count) && (gTable[Index].Src != 0); Index++) {
|
||||
if (gTable[Index].Src & Value) {
|
||||
*CdcFilter |= gTable[Index].Dst;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue