summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_getattrs.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2014-12-12 16:43:04 +0100
committerMark Wielaard <[email protected]>2014-12-17 16:35:56 +0100
commit9202665816763fad8524dd78a664dbcaa157b8d4 (patch)
treea895bade664b2701de624f57d5c79a69ebcd7004 /libdw/dwarf_getattrs.c
parent274cbda6f5d5b7c57d488edaeb55876ba8705db3 (diff)
libdw: Make sure all attributes come with a (fake) CU for bound checks.
All attributes now have a reference to a (fake) CU that has startp and endp set to the data section where the form data comes from. Use that for bounds checking in __libdw_form_val_len and dwarf_formblock to make sure data read doesn't overflow any data section. Remove libdwP.h cu_data and use cu startp and endp directly where appropriate. Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libdw/dwarf_getattrs.c')
-rw-r--r--libdw/dwarf_getattrs.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/libdw/dwarf_getattrs.c b/libdw/dwarf_getattrs.c
index 9ea70fca..0c54e5d0 100644
--- a/libdw/dwarf_getattrs.c
+++ b/libdw/dwarf_getattrs.c
@@ -106,9 +106,7 @@ dwarf_getattrs (Dwarf_Die *die, int (*callback) (Dwarf_Attribute *, void *),
/* Skip over the rest of this attribute (if there is any). */
if (attr.form != 0)
{
- size_t len = __libdw_form_val_len (dbg, die->cu, attr.form,
- die_addr, endp);
-
+ size_t len = __libdw_form_val_len (die->cu, attr.form, die_addr);
if (unlikely (len == (size_t) -1l))
/* Something wrong with the file. */
return -1l;