mirror of
https://github.com/acidanthera/audk.git
synced 2025-09-24 18:27:49 +02:00
MdePkg/BasePeCoffLib2: Fix uninitialized RtContext for RelocateImage()
This commit is contained in:
parent
3a16df0e2d
commit
6d772a4b8e
@ -438,6 +438,13 @@ PeCoffRelocateImage (
|
||||
ASSERT (RuntimeContext != NULL || RuntimeContextSize == 0);
|
||||
ASSERT (RuntimeContext == NULL || RuntimeContextSize >= sizeof (PE_COFF_LOADER_RUNTIME_CONTEXT) + Context->RelocDirSize * (sizeof (UINT64) / sizeof (UINT16)));
|
||||
//
|
||||
// Initialise the Image runtime context header.
|
||||
//
|
||||
if (RuntimeContext != NULL) {
|
||||
RuntimeContext->RelocDirRva = Context->RelocDirRva;
|
||||
RuntimeContext->RelocDirSize = Context->RelocDirSize;
|
||||
}
|
||||
//
|
||||
// Verify the Relocation Directory is not empty.
|
||||
//
|
||||
if (Context->RelocDirSize == 0) {
|
||||
@ -458,13 +465,6 @@ PeCoffRelocateImage (
|
||||
if (RuntimeContext == NULL && Adjust == 0) {
|
||||
return RETURN_SUCCESS;
|
||||
}
|
||||
//
|
||||
// Initialise the Image runtime context header.
|
||||
//
|
||||
if (RuntimeContext != NULL) {
|
||||
RuntimeContext->RelocDirRva = Context->RelocDirRva;
|
||||
RuntimeContext->RelocDirSize = Context->RelocDirSize;
|
||||
}
|
||||
|
||||
RelocBlockOffset = Context->RelocDirRva;
|
||||
TopOfRelocDir = Context->RelocDirRva + Context->RelocDirSize;
|
||||
|
Loading…
x
Reference in New Issue
Block a user