summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorINDIA\sachinganesh <sachinganesh@ami.com>2025-01-28 15:47:03 +0530
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2025-01-28 15:04:30 +0000
commit428cd8a46fb3bd8468183e2ac30bbbee2c25689b (patch)
tree5277d27ad28ecb31f63140fb8ebc767b9f63b211
parent18984b68fed23fbf3460fa58daddeace33c7c6f2 (diff)
downloadedk2-428cd8a46fb3bd8468183e2ac30bbbee2c25689b.tar.gz
MdePkg: Fix Clang Build Error
Fixed Clang build error introduced by unintialized variables in https://github.com/tianocore/edk2/commit/6278bbb89822c598fcd0637ae74174e367895c84 Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
-rw-r--r--MdePkg/Library/BasePeCoffLib/BasePeCoff.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
index ccb963407e..92285dfd05 100644
--- a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
+++ b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
@@ -1056,6 +1056,8 @@ PeCoffLoaderRelocateImage (
RelocDir = &Hdr.Te->DataDirectory[0];
}
+ RelocBase = NULL;
+ RelocBaseEnd = NULL;
if ((RelocDir != NULL) && (RelocDir->Size > 0)) {
Status = SafeUint32Add (RelocDir->VirtualAddress, (RelocDir->Size - 1), &EndAddress);
if (!RETURN_ERROR (Status)) {
@@ -1072,11 +1074,6 @@ PeCoffLoaderRelocateImage (
DEBUG ((DEBUG_ERROR, "Relocation block is not valid\n"));
return RETURN_LOAD_ERROR;
}
- } else {
- //
- // Set base and end to bypass processing below.
- //
- RelocBase = RelocBaseEnd = NULL;
}
RelocBaseOrg = RelocBase;