Skip to content

Commit

Permalink
Fix NULL pointer dereference in data references analyzer (#13178)
Browse files Browse the repository at this point in the history
Data references analyzer assumes that each function reference maps
to a certain section, but this is not the case for raw binary files
like shellcodes/firmware images/etc.

This bug was introduced in #10117.
  • Loading branch information
edigaryev authored and radare committed Feb 23, 2019
1 parent d4becbd commit 65360dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libr/core/canal.c
Expand Up @@ -1847,7 +1847,7 @@ R_API void r_core_anal_datarefs(RCore *core, ut64 addr) {
r_list_foreach (refs, iter, ref) {
RBinObject *obj = r_bin_cur_object (core->bin);
RBinSection *binsec = r_bin_get_section_at (obj, ref->addr, true);
if (binsec->is_data) {
if (binsec && binsec->is_data) {
if (!found) {
r_cons_printf ("agn %s\n", me);
found = true;
Expand Down

0 comments on commit 65360dd

Please sign in to comment.