summaryrefslogtreecommitdiff
path: root/libdwfl
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2015-05-24 00:07:33 +0200
committerMark Wielaard <mjw@redhat.com>2015-05-27 23:15:11 +0200
commite115bda377091bc211a786cdc7474337dd5508b6 (patch)
tree212dc6203775cf044974fd355d5a5529fe62a11e /libdwfl
parent712f3c8930a372345b94270ede67233f94a7263b (diff)
downloadelfutils-e115bda377091bc211a786cdc7474337dd5508b6.tar.gz
libdwfl: Check mod is not NULL in check_module.
check_module is called from dwfl_module_relocate_address and from dwfl_module_address_section. Both could take a NULL Dwfl_Module if an earlier error had occured. Make check_module return immediately indicating an issue in that case. Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'libdwfl')
-rw-r--r--libdwfl/ChangeLog4
-rw-r--r--libdwfl/derelocate.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 90fc0f30..dec3405b 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,7 @@
+2015-05-24 Mark Wielaard <mjw@redhat.com>
+
+ * derelocate.c (check_module): Check mod is not NULL.
+
2015-05-22 Mark Wielaard <mjw@redhat.com>
* link_map.c (dwfl_link_map_report): Allocate phdrs and dyn with
diff --git a/libdwfl/derelocate.c b/libdwfl/derelocate.c
index 2889fe41..48f81935 100644
--- a/libdwfl/derelocate.c
+++ b/libdwfl/derelocate.c
@@ -285,6 +285,9 @@ dwfl_module_relocation_info (Dwfl_Module *mod, unsigned int idx,
static bool
check_module (Dwfl_Module *mod)
{
+ if (mod == NULL)
+ return true;
+
if (INTUSE(dwfl_module_getsymtab) (mod) < 0)
{
Dwfl_Error error = dwfl_errno ();