refix dwarf crash

This commit is contained in:
Álvaro Felipe Melchor 2016-07-17 19:20:48 +02:00
parent 0d42b6c017
commit 965c0400d2

View File

@ -1105,7 +1105,7 @@ static const ut8 *r_bin_dwarf_parse_attr_value(const ut8 *obuf, int obuf_len,
const ut8 *buf_end = obuf + obuf_len;
size_t j;
if (!spec || !value || !hdr || !obuf || !*obuf) {
if (!spec || !value || !hdr || !obuf) {
return NULL;
}
value->form = spec->attr_form;
@ -1161,7 +1161,7 @@ static const ut8 *r_bin_dwarf_parse_attr_value(const ut8 *obuf, int obuf_len,
value->encoding.data = READ (buf, ut64);
break;
case DW_FORM_string:
value->encoding.str_struct.string = strdup((const char*)buf);
value->encoding.str_struct.string = *buf? strdup((const char*)buf) : NULL;
buf += (strlen((const char*)buf) + 1);
break;
case DW_FORM_block: