bound fat arch count against overflow in macho_parse_fat_file (#2209)

This commit is contained in:
jmestwa-coder
2026-06-24 11:49:43 +02:00
committed by GitHub
parent 1d58245c8e
commit ff983bd822
+1 -1
View File
@@ -729,7 +729,7 @@ void macho_parse_fat_file(
uint32_t count = yr_be32toh(header->nfat_arch);
yr_set_integer(count, object, "nfat_arch");
if (size < sizeof(yr_fat_header_t) + count * fat_arch_sz)
if (count > (size - sizeof(yr_fat_header_t)) / fat_arch_sz)
return;
yr_fat_arch_64_t arch;