diff --git a/util/fipstools/inject_hash/macho_parser/macho_parser.c b/util/fipstools/inject_hash/macho_parser/macho_parser.c index 5a0958bcf61..04cd5b320aa 100644 --- a/util/fipstools/inject_hash/macho_parser/macho_parser.c +++ b/util/fipstools/inject_hash/macho_parser/macho_parser.c @@ -56,6 +56,7 @@ int read_macho_file(const char *filename, machofile *macho) { int const_found = 0; int symtab_found = 0; + // mach-o/loader.h explains that cmdsize (and by extension sizeofcmds) must be a multiple of 8 on 64-bit systems. struct load_command will always be 8 bytes. for (uint32_t i = 0; i < macho->macho_header.sizeofcmds / sizeof(struct load_command); i += load_commands[i].cmdsize / sizeof(struct load_command)) { if (load_commands[i].cmd == LC_SEGMENT_64) { struct segment_command_64 *segment = (struct segment_command_64 *)&load_commands[i];