public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libdwfl: Check mod is not NULL in check_module.
@ 2015-05-23 22:10 Mark Wielaard
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Wielaard @ 2015-05-23 22:10 UTC (permalink / raw)
  To: elfutils-devel

[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]

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    | 4 ++++
 libdwfl/derelocate.c | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 90fc0f3..dec3405 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 cec9655..4e5a568 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 ();
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libdwfl: Check mod is not NULL in check_module.
@ 2015-05-27 21:14 Mark Wielaard
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Wielaard @ 2015-05-27 21:14 UTC (permalink / raw)
  To: elfutils-devel

[-- Attachment #1: Type: text/plain, Size: 100 bytes --]

On Tue, May 26, 2015 at 12:45:08PM -0700, Roland McGrath wrote:
> OK

Thanks. Pushed to master.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] libdwfl: Check mod is not NULL in check_module.
@ 2015-05-26 19:45 Roland McGrath
  0 siblings, 0 replies; 3+ messages in thread
From: Roland McGrath @ 2015-05-26 19:45 UTC (permalink / raw)
  To: elfutils-devel

[-- Attachment #1: Type: text/plain, Size: 4 bytes --]

OK

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-27 21:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-23 22:10 [PATCH] libdwfl: Check mod is not NULL in check_module Mark Wielaard
2015-05-26 19:45 Roland McGrath
2015-05-27 21:14 Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).