summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_offdie.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdw/dwarf_offdie.c')
-rw-r--r--libdw/dwarf_offdie.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libdw/dwarf_offdie.c b/libdw/dwarf_offdie.c
index 15f55c22..883720de 100644
--- a/libdw/dwarf_offdie.c
+++ b/libdw/dwarf_offdie.c
@@ -1,5 +1,5 @@
/* Return DIE at given offset.
- Copyright (C) 2002-2010 Red Hat, Inc.
+ Copyright (C) 2002-2010, 2017 Red Hat, Inc.
This file is part of elfutils.
Written by Ulrich Drepper <[email protected]>, 2002.
@@ -45,7 +45,7 @@ __libdw_offdie (Dwarf *dbg, Dwarf_Off offset, Dwarf_Die *result,
Elf_Data *const data = dbg->sectiondata[debug_types ? IDX_debug_types
: IDX_debug_info];
- if (offset >= data->d_size)
+ if (data == NULL || offset >= data->d_size)
{
__libdw_seterrno (DWARF_E_INVALID_DWARF);
return NULL;