diff --git a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c index 929602305c..6dcd7da5e6 100644 --- a/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c +++ b/MdeModulePkg/Core/Dxe/Misc/MemoryProtection.c @@ -236,7 +236,7 @@ ProtectUefiImage ( // // CPU ARCH present. Update memory attribute directly. // - if (PcdGetBool (PcdEnableUserSpace)) { + if (PcdGetBool (PcdEnableUserSpace) && (PdbPointer != NULL)) { if (AsciiStrStr (PdbPointer, "Fat") != NULL) { SetUefiImageProtectionAttributes (ImageRecord, TRUE); *IsUserImage = TRUE;