To make parsing DebugImageInfoTable easier and safer, require the
LoadedImage protocol instance to be valid for every NormalImage
entry.

Cc: Leif Lindholm <l...@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianoc...@kernel.org>
Cc: Abner Chang <abner.ch...@hpe.com>
Cc: Daniel Schaefer <daniel.schae...@hpe.com>
Cc: Vitaly Cheptsov <vit9...@protonmail.com>
Signed-off-by: Marvin Häuser <mhaeu...@posteo.de>
---
 EmbeddedPkg/GdbStub/GdbStub.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/EmbeddedPkg/GdbStub/GdbStub.c b/EmbeddedPkg/GdbStub/GdbStub.c
index 09167fdafb4d..29aa63237304 100644
--- a/EmbeddedPkg/GdbStub/GdbStub.c
+++ b/EmbeddedPkg/GdbStub/GdbStub.c
@@ -1044,8 +1044,9 @@ QxferLibrary (
   if (gDebugTable != NULL) {

     for (; gEfiDebugImageTableEntry < gDebugImageTableHeader->TableSize; 
gEfiDebugImageTableEntry++, gDebugTable++) {

       if (gDebugTable->ImageInfoType != NULL) {

-        if ((*gDebugTable->ImageInfoType == EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL) 
&&

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

+        if (*gDebugTable->ImageInfoType == EFI_DEBUG_IMAGE_INFO_TYPE_NORMAL) {

+          ASSERT (gDebugTable->NormalImage->LoadedImageProtocolInstance != 
NULL);

+

           Pdb = PeCoffLoaderGetDebuggerInfo (

                  
gDebugTable->NormalImage->LoadedImageProtocolInstance->ImageBase,

                  &LoadAddress

-- 
2.31.1



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


Reply via email to