From 965c0400d2826408f3efc619fec20919bf56da1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Felipe=20Melchor?= Date: Sun, 17 Jul 2016 19:20:48 +0200 Subject: [PATCH] refix dwarf crash --- libr/bin/dwarf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libr/bin/dwarf.c b/libr/bin/dwarf.c index 89c47c2672..21df4e01cf 100644 --- a/libr/bin/dwarf.c +++ b/libr/bin/dwarf.c @@ -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: