mirror of https://github.com/acidanthera/audk.git
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:
parent
04ae17218d
commit
1fb80369b7
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue