mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-26 15:14:02 +02:00
UefiCpuPkg/MtrrLib: Fix unit test read overflow
Change conditional check to check the array index before reading the array member to prevent read past end of buffer. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
parent
fadf4f377e
commit
171335e34e
@ -745,7 +745,7 @@ GetNextDifferentElementInSortedArray (
|
|||||||
UINT64 CurrentElement;
|
UINT64 CurrentElement;
|
||||||
|
|
||||||
CurrentElement = Array[Index];
|
CurrentElement = Array[Index];
|
||||||
while (CurrentElement == Array[Index] && Index < Count) {
|
while ((Index < Count) && (CurrentElement == Array[Index])) {
|
||||||
Index++;
|
Index++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user