mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2025-12-08 19:25:01 +00:00
OcMachoLib: Drop the "minimal LC size" check.
It is implicitly covered by the checks below and worsens performance of valid binaries in favor of increasing it for invalid ones.
This commit is contained in:
parent
a5f7f6bed9
commit
b74e10e066
@ -51,7 +51,6 @@ MachoInitializeContext (
|
||||
OUT VOID *Context
|
||||
)
|
||||
{
|
||||
UINTN MinCommandsSize;
|
||||
UINTN TopOfCommands;
|
||||
UINTN Index;
|
||||
CONST MACH_LOAD_COMMAND *Command;
|
||||
@ -64,11 +63,9 @@ MachoInitializeContext (
|
||||
//
|
||||
// Verify Mach-O Header sanity.
|
||||
//
|
||||
TopOfCommands = ((UINTN)MachHeader->Commands + MachHeader->CommandsSize);
|
||||
MinCommandsSize = (MachHeader->NumCommands * sizeof (*MachHeader->Commands));
|
||||
TopOfCommands = ((UINTN)MachHeader->Commands + MachHeader->CommandsSize);
|
||||
if ((FileSize < sizeof (*MachHeader))
|
||||
|| (MachHeader->Signature != MACH_HEADER_64_SIGNATURE)
|
||||
|| (MachHeader->CommandsSize < MinCommandsSize)
|
||||
|| (TopOfCommands > ((UINTN)MachHeader + FileSize))) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user