Fix section->size = 0 assert

This commit is contained in:
pancake 2019-01-30 07:36:39 -06:00
parent 5535b6f380
commit c9472f4768
2 changed files with 1 additions and 3 deletions

View File

@ -5,7 +5,6 @@
This code has been written by pancake which has been based on Alvaro's r2pipe-python
script which was based on FireEye script for IDA Pro.
*
* https://www.fireeye.com/blog/threat-research/2017/03/introduction_to_reve.html
#endif

View File

@ -2464,7 +2464,7 @@ static int bin_sections(RCore *r, int mode, ut64 laddr, int va, ut64 at, const c
free (hashstr);
} else if (IS_MODE_JSON (mode)) {
char *hashstr = NULL;
if (chksum) {
if (chksum && section->size > 0) {
ut8 *data = malloc (section->size);
if (!data) {
goto out;
@ -2474,7 +2474,6 @@ static int bin_sections(RCore *r, int mode, ut64 laddr, int va, ut64 at, const c
hashstr = build_hash_string (mode, chksum,
data, datalen);
free (data);
}
r_cons_printf ("%s{\"name\":\"%s\","
"\"size\":%"PFMT64d","