MdeModulePkg/PlatformDriOverrideDxe: Fix overflow condition check

Code mistake, VariableIndex is smaller normally than buffer+buffersize
so should not break loop.

Signed-off-by: Walon Li <walon.li@hpe.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
Li, Walon 2021-05-13 10:48:40 +08:00 committed by mergify[bot]
parent 04ae17218d
commit 1fb80369b7
1 changed files with 1 additions and 1 deletions

View File

@ -776,7 +776,7 @@ InitOverridesMapping (
// Check buffer overflow
//
if ((DriverImageInfo->DriverImagePath == NULL) || (VariableIndex < (UINT8 *) DriverDevicePath) ||
(VariableIndex < (UINT8 *) VariableBuffer + BufferSize)) {
(VariableIndex > (UINT8 *) VariableBuffer + BufferSize)) {
Corrupted = TRUE;
break;
}