bin/demangle: fix possible SEGV when dereferencing binfile

This commit is contained in:
Riccardo Schirone 2016-02-18 13:52:31 +01:00
parent 8a1968824c
commit 5d08aee9af

View File

@ -345,8 +345,10 @@ R_API int r_bin_lang_type(RBinFile *binfile, const char *def, const char *sym) {
R_API char *r_bin_demangle (RBinFile *binfile, const char *def, const char *str) {
int type = -1;
RBin *bin = binfile->rbin;
RBin *bin;
if (!binfile) return NULL;
bin = binfile->rbin;
if (!strncmp (str, "sym.", 4))
str += 4;
if (!strncmp (str, "imp.", 4))