diff options
author | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-08-05 20:03:44 +0000 |
---|---|---|
committer | andrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524> | 2010-08-05 20:03:44 +0000 |
commit | 21ff163c8c023ba599d29482b5badfb324c27b88 (patch) | |
tree | 42b3ef3a37c47b574f02ddf289c3105165169c79 /Nt32Pkg/Library | |
parent | c0351cfecaa19d9e3384fd7180c621ec1ace4caa (diff) | |
download | edk2-21ff163c8c023ba599d29482b5badfb324c27b88.zip edk2-21ff163c8c023ba599d29482b5badfb324c27b88.tar.gz edk2-21ff163c8c023ba599d29482b5badfb324c27b88.tar.bz2 |
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
Diffstat (limited to 'Nt32Pkg/Library')
-rw-r--r-- | Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c b/Nt32Pkg/Library/DxeNt32PeCoffExtraActionLib/DxeNt32PeCoffExtraActionLib.c index 93d9cb2..a816d70 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) {
|