Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix oobread in macho core symbolication ##crash
* Reported by @cnitlrt via huntr.dev
  • Loading branch information
radare committed Feb 21, 2022
1 parent 515e592 commit a35f89f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libr/bin/format/mach0/coresymbolication.c
Expand Up @@ -222,7 +222,7 @@ RCoreSymCacheElement *r_coresym_cache_element_new(RBinFile *bf, RBuffer *buf, ut
}
size_t i;
ut8 *cursor = b + R_CS_EL_OFF_SEGS;
for (i = 0; i < hdr->n_segments && cursor < end; i++) {
for (i = 0; i < hdr->n_segments && cursor + sizeof (RCoreSymCacheElementSegment) < end; i++) {
RCoreSymCacheElementSegment *seg = &result->segments[i];
seg->paddr = seg->vaddr = r_read_le64 (cursor);
cursor += 8;
Expand Down

0 comments on commit a35f89f

Please sign in to comment.