From 9372c11996536d385ec4b345ceb83038ba7bfb9e Mon Sep 17 00:00:00 2001 From: pancake Date: Sun, 9 Jul 2017 13:08:13 +0200 Subject: [PATCH] Fix #7887 - null deref in bin_get_endian() --- libr/bin/bin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libr/bin/bin.c b/libr/bin/bin.c index 0a59054b70..df9cd4d3c2 100644 --- a/libr/bin/bin.c +++ b/libr/bin/bin.c @@ -1986,7 +1986,7 @@ R_API RList *r_bin_get_mem(RBin *bin) { R_API int r_bin_is_big_endian(RBin *bin) { RBinObject *o = r_bin_cur_object (bin); - return o? o->info->big_endian: -1; + return (o && o->info)? o->info->big_endian: -1; } R_API int r_bin_is_stripped(RBin *bin) {