This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
Clear Dwarf_CFI ebl field in dwarf_getcfi
- From: Mark Wielaard <mjw at redhat dot com>
- To: elfutils-devel at lists dot fedorahosted dot org
- Date: Wed, 09 Sep 2009 21:06:45 +0200
- Subject: Clear Dwarf_CFI ebl field in dwarf_getcfi
Hi,
I was getting some crashes because the struct Dwarf_CFI ebl field
sometimes contained garbage. This patch explicitly clears the field in
dwarf_getcfi after the structure is allocated through
libdw_typed_alloc(). Other locations where a struct Dwarf_CFI is created
aren't a problem since they allocate through calloc() which guarantees
the memory is cleared.
OK to push?
Mark
>From 418ae4c39762d823177c477cedb19ec10e00dfee Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw@redhat.com>
Date: Wed, 9 Sep 2009 20:59:26 +0200
Subject: [PATCH] Clear cfi->ebl in dwarf_getcfi().
---
libdw/ChangeLog | 4 ++++
libdw/dwarf_getcfi.c | 2 ++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 82a7a4a..6f47fc7 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-09 Mark Wielaard <mjw@redhat.com>
+
+ * dwarf_getcfi.c (dwarf_getcfi): Clear cfi->ebl.
+
2009-08-21 Josh Stone <jistone@redhat.com>
* dwarf_hasattr_integrate.c: Integrate DW_AT_specification too.
diff --git a/libdw/dwarf_getcfi.c b/libdw/dwarf_getcfi.c
index a89bf8f..c935631 100644
--- a/libdw/dwarf_getcfi.c
+++ b/libdw/dwarf_getcfi.c
@@ -84,6 +84,8 @@ dwarf_getcfi (dbg)
cfi->next_offset = 0;
cfi->cie_tree = cfi->fde_tree = cfi->expr_tree = NULL;
+ cfi->ebl = NULL;
+
dbg->cfi = cfi;
}
--
1.6.4.2