OcMachoLib: Consider the LC buffer might be padded when retrieving the next.

This commit is contained in:
Download-Fritz 2018-10-21 12:03:18 +02:00
parent b74e10e066
commit 1ec1df5e78

View File

@ -183,7 +183,8 @@ InternalGetNextCommand64 (
for (
;
(UINTN)Command < TopOfCommands;
((UINTN)Command + sizeof (MACH_LOAD_COMMAND)) < TopOfCommands
&& ((UINTN)Command + Command->CommandSize) < TopOfCommands;
Command = NEXT_MACH_LOAD_COMMAND (Command)
) {
if (Command->CommandType == LoadCommandType) {