mirror of
https://github.com/VirusTotal/yara.git
synced 2026-10-12 02:10:00 +00:00
bound fat arch count against overflow in macho_parse_fat_file (#2209)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user