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>
This commit is contained in:
Mark Wielaard
2015-05-24 00:07:33 +02:00
parent 712f3c8930
commit e115bda377
2 changed files with 7 additions and 0 deletions
+4
View 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
+3
View 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 ();