public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] addr2line: Set scopes to NULL after free in handle_address.
@ 2015-05-21 14:07 Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2015-05-21 14:07 UTC (permalink / raw)
  To: elfutils-devel

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

If dwarf_getscopes_die () fails then scopes might not be reset and we
could cause a double free.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
---
 src/ChangeLog   | 4 ++++
 src/addr2line.c | 1 +
 2 files changed, 5 insertions(+)

diff --git a/src/ChangeLog b/src/ChangeLog
index c93d54d..ee18007 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2015-05-21  Mark Wielaard  <mjw@redhat.com>
+
+	* addr2line.c (handle_address): Set scopes to NULL after free.
+
 2015-05-20  Mark Wielaard  <mjw@redhat.com>
 
 	* addr2line.c (OPT_PRETTY): New constant define.
diff --git a/src/addr2line.c b/src/addr2line.c
index fc2ff28..97f988f 100644
--- a/src/addr2line.c
+++ b/src/addr2line.c
@@ -744,6 +744,7 @@ handle_address (const char *string, Dwfl *dwfl)
 	  dwarf_offdie (dwfl_module_getdwarf (mod, &bias),
 			dieoff, &subroutine);
 	  free (scopes);
+	  scopes = NULL;
 
 	  nscopes = dwarf_getscopes_die (&subroutine, &scopes);
 	  if (nscopes > 1)
-- 
1.8.3.1


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

* Re: [PATCH] addr2line: Set scopes to NULL after free in handle_address.
@ 2015-05-27 15:31 Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2015-05-27 15:31 UTC (permalink / raw)
  To: elfutils-devel

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

On Thu, 2015-05-21 at 16:07 +0200, Mark Wielaard wrote:
> If dwarf_getscopes_die () fails then scopes might not be reset and we
> could cause a double free.

Pushed to master.

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-21 14:07 [PATCH] addr2line: Set scopes to NULL after free in handle_address Mark Wielaard
2015-05-27 15:31 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).