[edk2-devel] [edk2-platforms][PATCH 08/10] Ext4Pkg: Fix possible int overflow in Ext4ExtentsMapKeyCompare

Savva Mitrofanov posted 10 patches 3 years, 6 months ago
[edk2-devel] [edk2-platforms][PATCH 08/10] Ext4Pkg: Fix possible int overflow in Ext4ExtentsMapKeyCompare
Posted by Savva Mitrofanov 3 years, 6 months ago
Cc: Marvin Häuser <mhaeuser@posteo.de>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
---
 Features/Ext4Pkg/Ext4Dxe/Extents.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Features/Ext4Pkg/Ext4Dxe/Extents.c b/Features/Ext4Pkg/Ext4Dxe/Extents.c
index c5951f78aa62..80427d869bd3 100644
--- a/Features/Ext4Pkg/Ext4Dxe/Extents.c
+++ b/Features/Ext4Pkg/Ext4Dxe/Extents.c
@@ -421,7 +421,7 @@ Ext4ExtentsMapKeyCompare (
   Extent = UserStruct;

   Block  = (UINT32)(UINTN)StandaloneKey;

 

-  if ((Block >= Extent->ee_block) && (Block < Extent->ee_block + Ext4GetExtentLength (Extent))) {

+  if ((Block >= Extent->ee_block) && (Block - Extent->ee_block < Ext4GetExtentLength (Extent))) {

     return 0;

   }

 

-- 
2.37.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#91654): https://edk2.groups.io/g/devel/message/91654
Mute This Topic: https://groups.io/mt/92531470/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-