MdePkg/BasePeCoffLib2: Fix invalid ASSERT for when RelocDirSize == 0

This commit is contained in:
Marvin Häuser 2023-05-03 21:28:01 +02:00 committed by Mikhail Krichanov
parent 4d8020f9e7
commit 0c7d4d57cb

View File

@ -796,6 +796,12 @@ PeCoffRuntimeRelocateImage (
ASSERT (Image != NULL);
ASSERT (BaseAddress != 0);
ASSERT (RuntimeContext != NULL);
//
// If the relocation directory is empty, skip relocation.
//
if (RuntimeContext->RelocDirSize == 0) {
return RETURN_SUCCESS;
}
//
// The arithmetics in this function generally cannot overflow due to the