diff --git a/libr/bin/p/bin_symbols.c b/libr/bin/p/bin_symbols.c index 2036dc092b6b6..779e36940ff1d 100644 --- a/libr/bin/p/bin_symbols.c +++ b/libr/bin/p/bin_symbols.c @@ -181,7 +181,7 @@ static RBinSymbol *bin_symbol_from_symbol(RCoreSymCacheElement *element, RCoreSy static RCoreSymCacheElement *parseDragons(RBinFile *bf, RBuffer *buf, int off, int bits, R_OWN char *file_name) { D eprintf ("Dragons at 0x%x\n", off); - ut64 size = r_buf_size (buf); + st64 size = r_buf_size (buf); if (off >= size) { return NULL; } @@ -189,6 +189,9 @@ static RCoreSymCacheElement *parseDragons(RBinFile *bf, RBuffer *buf, int off, i if (!size) { return NULL; } + if (size < 32) { + return NULL; + } ut8 *b = malloc (size); if (!b) { return NULL;