mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +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;
|
||||
|
||||
CurrentElement = Array[Index];
|
||||
while (CurrentElement == Array[Index] && Index < Count) {
|
||||
while ((Index < Count) && (CurrentElement == Array[Index])) {
|
||||
Index++;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user