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