]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libdwfl: Check mod is not NULL in check_module.
authorMark Wielaard <mjw@redhat.com>
Sat, 23 May 2015 22:07:33 +0000 (00:07 +0200)
committerMark Wielaard <mjw@redhat.com>
Wed, 27 May 2015 21:15:11 +0000 (23:15 +0200)
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>
libdwfl/ChangeLog
libdwfl/derelocate.c

index 90fc0f309373329040518a191fdde96740023b5d..dec3405bea7f1b89eccb246f7581e3b397b1c7c8 100644 (file)
@@ -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
index 2889fe4158f24a65245f71721cabb47a9330a973..48f819353cd492a21d90ac266087b96f75440a2d 100644 (file)
@@ -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 ();