diff options
author | Li, Walon <walon.li@hpe.com> | 2021-05-13 10:48:40 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-05-21 08:31:39 +0000 |
commit | 1fb80369b72c6ba7f80b442e4acf771a6dd56ee7 (patch) | |
tree | ff0c00315cc522fc062219bd63b47b2375b74737 /MdeModulePkg/Universal | |
parent | 04ae17218deec25c6f488609c5e2ca9c419d2c4b (diff) | |
download | edk2-1fb80369b72c6ba7f80b442e4acf771a6dd56ee7.tar.gz edk2-1fb80369b72c6ba7f80b442e4acf771a6dd56ee7.tar.bz2 edk2-1fb80369b72c6ba7f80b442e4acf771a6dd56ee7.zip |
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>
Diffstat (limited to 'MdeModulePkg/Universal')
-rw-r--r-- | MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c index f91f038b7a..bd2d04452f 100644 --- a/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c +++ b/MdeModulePkg/Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c @@ -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;
}
|