Skip to content
Permalink
Browse files Browse the repository at this point in the history
Fix #10465 - Avoid string on low addresses (workaround) for corrupted…
… dwarf (#10478)
  • Loading branch information
radare committed Jun 24, 2018
1 parent e84cf42 commit d37d2b8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libr/bin/dwarf.c
Expand Up @@ -1361,7 +1361,11 @@ static const ut8 *r_bin_dwarf_parse_comp_unit(Sdb *s, const ut8 *obuf,
&cu->hdr, debug_str, debug_str_len);
if (cu->dies[cu->length].attr_values[i].name == DW_AT_comp_dir) {
const char *name = cu->dies[cu->length].attr_values[i].encoding.str_struct.string;
sdb_set (s, "DW_AT_comp_dir", name, 0);
if (name > 1024) { // solve some null derefs
sdb_set (s, "DW_AT_comp_dir", name, 0);
} else {
eprintf ("Invalid string pointer at %p\n", name);
}
}
cu->dies[cu->length].length++;
}
Expand Down

0 comments on commit d37d2b8

Please sign in to comment.