diff options
author | Marvin Häuser <Marvin.Haeuser@outlook.com> | 2018-02-27 18:23:39 +0100 |
---|---|---|
committer | Jiewen Yao <jiewen.yao@intel.com> | 2018-02-28 09:14:08 +0800 |
commit | c9d1705ba26a4f7656e92ed382472d4ff175761c (patch) | |
tree | 4d60df8a28e39f9d32b499ec776a79d6d3a5d09b | |
parent | 2f3197b485e3b887580e568c1f3da4c011fcf60d (diff) | |
download | edk2-platforms-c9d1705ba26a4f7656e92ed382472d4ff175761c.tar.xz |
MinPlatformPkg/TestPointCheckLib: Prevent the usage of uninitialized variables.
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
-rw-r--r-- | Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckBootVariable.c | 2 | ||||
-rw-r--r-- | Platform/Intel/MinPlatformPkg/Test/Library/TestPointCheckLib/DxeCheckLoadedImage.c | 4 |
2 files changed, 6 insertions, 0 deletions
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;
|