From: andrewfish Date: Thu, 5 Aug 2010 20:03:44 +0000 (+0000) Subject: Make PeCoffExtraActionLib more robust, in case it is called before its constructor... X-Git-Tag: edk2-stable201903~15622 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=21ff163c8c023ba599d29482b5badfb324c27b88;p=mirror_edk2.git Make PeCoffExtraActionLib more robust, in case it is called before its constructor gets called. This fixes a crash in TOT. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10775 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c b/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c index 93d9cb2ed0..a816d704e2 100644 --- a/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c +++ b/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c @@ -283,6 +283,10 @@ PeCoffLoaderRelocateImageExtraAction ( ASSERT (ImageContext != NULL); + if (mWinNt == NULL) { + return; + } + // // If we load our own PE COFF images the Windows debugger can not source // level debug our code. If a valid PDB pointer exists usw it to load @@ -396,6 +400,9 @@ PeCoffLoaderUnloadImageExtraAction ( VOID *ModHandle; ASSERT (ImageContext != NULL); + if (mWinNt == NULL) { + return; + } ModHandle = RemoveModeHandle (ImageContext); if (ModHandle != NULL) {