The other dwarf unit/cu iterators handle a NULL Dwarf handle as an
existing error and return NULL. Don't crash.
Signed-off-by: Mark Wielaard <mark@klomp.org>
2018-06-08 Mark Wielaard <mark@klomp.org>
2018-06-08 Mark Wielaard <mark@klomp.org>
+ * dwarf_get_units.c (dwarf_get_units): Handle existing error, no
+ dwarf.
+
+2018-06-08 Mark Wielaard <mark@klomp.org>
+
* dwarf_getlocation.c (store_implicit_value): Return error when
seeing bad DWARF or when tsearch runs out of memory.
(__libdw_intern_expression): Report error when store_implicit_value
* dwarf_getlocation.c (store_implicit_value): Return error when
seeing bad DWARF or when tsearch runs out of memory.
(__libdw_intern_expression): Report error when store_implicit_value
Dwarf_Half *version, uint8_t *unit_type,
Dwarf_Die *cudie, Dwarf_Die *subdie)
{
Dwarf_Half *version, uint8_t *unit_type,
Dwarf_Die *cudie, Dwarf_Die *subdie)
{
+ /* Handle existing error. */
+ if (dwarf == NULL)
+ return -1;
+
Dwarf_Off off;
bool v4type;
if (cu == NULL)
Dwarf_Off off;
bool v4type;
if (cu == NULL)