diff options
| author | Mark Wielaard <[email protected]> | 2014-11-23 23:21:05 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2014-11-26 20:25:58 +0100 |
| commit | 59480ba86fdaad7eb2e104b69af4a3b07e20d6fb (patch) | |
| tree | f5732c386943641cb75f705fcc1e0563457cd8b8 /libdw/dwarf_siblingof.c | |
| parent | 04b61f8601bf9267976cc4461091622ffdbadf67 (diff) | |
libdw: Always check __libdw_find_attr return value.
__libdw_find_attr will return NULL and might not set code or form.
Only use code or form if the returned address is not NULL.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdw/dwarf_siblingof.c')
| -rw-r--r-- | libdw/dwarf_siblingof.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libdw/dwarf_siblingof.c b/libdw/dwarf_siblingof.c index c54b6c8d..f2dc4688 100644 --- a/libdw/dwarf_siblingof.c +++ b/libdw/dwarf_siblingof.c @@ -1,5 +1,5 @@ /* Return sibling of given DIE. - Copyright (C) 2003-2010 Red Hat, Inc. + Copyright (C) 2003-2010, 2014 Red Hat, Inc. This file is part of elfutils. Written by Ulrich Drepper <[email protected]>, 2003. @@ -72,7 +72,7 @@ dwarf_siblingof (die, result) /* Find the end of the DIE or the sibling attribute. */ addr = __libdw_find_attr (&this_die, DW_AT_sibling, &sibattr.code, &sibattr.form); - if (sibattr.code == DW_AT_sibling) + if (addr != NULL && sibattr.code == DW_AT_sibling) { Dwarf_Off offset; sibattr.valp = addr; |
