diff options
author | Mark Wielaard <mjw@redhat.com> | 2013-09-12 15:49:47 +0200 |
---|---|---|
committer | Mark Wielaard <mjw@redhat.com> | 2013-09-12 15:49:47 +0200 |
commit | 18b2c67fa2a422c744efba0d4c9a8cb9ef423823 (patch) | |
tree | 18dcac88ac023bda3588291d9be45a2e1166f331 /libdw | |
parent | cc3924843b9bc04ff7aae3b491b16bd1bd175613 (diff) | |
download | elfutils-18b2c67fa2a422c744efba0d4c9a8cb9ef423823.tar.gz |
Fix memory leak and set libdw errno when intern_fde cannot parse start/end.
Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'libdw')
-rw-r--r-- | libdw/ChangeLog | 5 | ||||
-rw-r--r-- | libdw/fde.c | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog index c8398b23..1a851948 100644 --- a/libdw/ChangeLog +++ b/libdw/ChangeLog @@ -1,3 +1,8 @@ +2013-09-12 Mark Wielaard <mjw@redhat.com> + + * fde.c (intern_fde): Free fde and set libdw errno when start + or end could not be read. + 2013-08-24 Mark Wielaard <mjw@redhat.com> * dwarf_getlocation.c (store_implicit_value): Don't take data diff --git a/libdw/fde.c b/libdw/fde.c index 32c77b0d..91ce7327 100644 --- a/libdw/fde.c +++ b/libdw/fde.c @@ -83,7 +83,11 @@ intern_fde (Dwarf_CFI *cache, const Dwarf_FDE *entry) &fde->instructions, &fde->start)) || unlikely (read_encoded_value (cache, cie->fde_encoding & 0x0f, &fde->instructions, &fde->end))) - return NULL; + { + free (fde); + __libdw_seterrno (DWARF_E_INVALID_DWARF); + return NULL; + } fde->end += fde->start; fde->cie = cie; |