+2014-11-23 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf_getabbrev.c (__libdw_getabbrev): Don't assert on bad DWARF.
+ Set libdw errno and return NULL.
+
2014-11-24 Mark Wielaard <mjw@redhat.com>
* dwarf.h (DW_LANG_C_plus_plus_11): Added.
/* Get abbreviation at given offset.
- Copyright (C) 2003, 2004, 2005, 2006 Red Hat, Inc.
+ Copyright (C) 2003, 2004, 2005, 2006, 2014 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <drepper@redhat.com>, 2003.
# include <config.h>
#endif
-#include <assert.h>
#include <dwarf.h>
#include "libdwP.h"
{
foundit = true;
- assert (abb->offset == offset);
+ if (unlikely (abb->offset != offset))
+ {
+ /* A duplicate abbrev code at a different offset,
+ that should never happen. */
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ return NULL;
+ }
/* If the caller doesn't need the length we are done. */
if (lengthp == NULL)