The sum of ImageBase + ImageSize yields the address of the first byte
outside of the range of the image. Adjust the address comparison
accordingly.

Cc: Leif Lindholm <l...@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
Cc: Vitaly Cheptsov <vit9...@protonmail.com>
Signed-off-by: Marvin Häuser <mhaeu...@posteo.de>
---
 ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi.c 
b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi.c
index e9fea4038252..a9b97cf7caf4 100644
--- a/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi.c
+++ b/ArmPkg/Library/DefaultExceptionHandlerLib/DefaultExceptionHandlerUefi.c
@@ -55,7 +55,7 @@ GetImageName (
       if ((DebugTable->NormalImage->ImageInfoType == 
EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL) &&

           (DebugTable->NormalImage->LoadedImageProtocolInstance != NULL)) {

         if ((Address >= (CHAR8 
*)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase) &&

-            (Address <= ((CHAR8 
*)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase + 
DebugTable->NormalImage->LoadedImageProtocolInstance->ImageSize))) {

+            (Address < ((CHAR8 
*)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase + 
DebugTable->NormalImage->LoadedImageProtocolInstance->ImageSize))) {

           *ImageBase = 
(UINTN)DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase;

           *PeCoffSizeOfHeaders = PeCoffGetSizeOfHeaders ((VOID 
*)(UINTN)*ImageBase);

           return PeCoffLoaderGetPdbPointer 
(DebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase);

-- 
2.31.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#78876): https://edk2.groups.io/g/devel/message/78876
Mute This Topic: https://groups.io/mt/84754048/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to