From c9d1705ba26a4f7656e92ed382472d4ff175761c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marvin=20H=C3=A4user?= Date: Tue, 27 Feb 2018 18:23:39 +0100 Subject: MinPlatformPkg/TestPointCheckLib: Prevent the usage of uninitialized variables. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser Reviewed-by: Jiewen Yao --- .../Test/Library/TestPointCheckLib/DxeCheckBootVariable.c | 2 ++ .../Test/Library/TestPointCheckLib/DxeCheckLoadedImage.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c index 968e7e47b0..4c622fa2d9 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c @@ -249,6 +249,8 @@ TestPointCheckBootVariable ( DEBUG ((DEBUG_INFO, "==== TestPointCheckBootVariable - Enter\n")); + ReturnStatus = EFI_SUCCESS; + Status = TestPointCheckLoadOptionVariable (); if (EFI_ERROR(Status)) { ReturnStatus = Status; diff --git a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckLoadedImage.c b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckLoadedImage.c index efcf7c9ae8..7e9393245f 100644 --- a/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckLoadedImage.c +++ b/Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckLoadedImage.c @@ -76,10 +76,14 @@ IsRuntimeImage ( Magic = Hdr.Pe32->OptionalHeader.Magic; } + Subsystem = 0; + if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) { Subsystem = Hdr.Pe32->OptionalHeader.Subsystem; } else if (Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) { Subsystem = Hdr.Pe32Plus->OptionalHeader.Subsystem; + } else { + ASSERT (FALSE); } if (Subsystem == EFI_IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER) { return TRUE; -- cgit v1.2.3