public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MdeModulePkg/PlatformDriOverrideDxe: Fix overflow condition check
@ 2021-05-13  2:48 Li, Walon
  2021-05-13  3:13 ` 回复: " gaoliming
       [not found] ` <167E81CF2BD0E45A.10691@groups.io>
  0 siblings, 2 replies; 3+ messages in thread
From: Li, Walon @ 2021-05-13  2:48 UTC (permalink / raw)
  To: devel; +Cc: walon.li, nickle.wang, dandan.bi, gaoliming

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

Signed-off-by:Walon Li <walon.li@hpe.com>
---
 .../Universal/PlatformDriOverrideDxe/PlatDriOverrideLib.c       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
         }
-- 
2.23.0.windows.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-05-21  5:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-13  2:48 [PATCH] MdeModulePkg/PlatformDriOverrideDxe: Fix overflow condition check Li, Walon
2021-05-13  3:13 ` 回复: " gaoliming
     [not found] ` <167E81CF2BD0E45A.10691@groups.io>
2021-05-21  5:40   ` 回复: [edk2-devel] " gaoliming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox