From ca8d8b39f3e34a4fd943270330b80f1148129de4 Mon Sep 17 00:00:00 2001 From: pancake Date: Tue, 5 Apr 2022 11:52:32 +0200 Subject: [PATCH] Fix oobread in the macho parser ##crash * Reported by @Han0nly via huntr.dev * Reproducers: heapoverflow1 * BountyID: e589bd97-4c74-4e79-93b5-0951a281facc --- libr/bin/format/mach0/mach0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libr/bin/format/mach0/mach0.c b/libr/bin/format/mach0/mach0.c index 1bf09233ab458..8aaf3f49a18b0 100644 --- a/libr/bin/format/mach0/mach0.c +++ b/libr/bin/format/mach0/mach0.c @@ -3178,7 +3178,7 @@ static void parse_relocation_info(struct MACH0_(obj_t) *bin, RSkipList *relocs, for (i = 0; i < num; i++) { struct relocation_info a_info = info[i]; ut32 sym_num = a_info.r_symbolnum; - if (sym_num > bin->nsymtab) { + if (sym_num >= bin->nsymtab) { continue; }