summaryrefslogtreecommitdiffstats
path: root/libdw
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2019-04-27 23:58:57 +0200
committerMark Wielaard <mark@klomp.org>2019-04-28 00:03:13 +0200
commit2b55f157cd74278c0c01e8605de3bbb160d3bde4 (patch)
tree67dca1f9a4f48d12a24432917cb37160c47a69b5 /libdw
parentf8000d58a009379a3c7aa2267d7a473f12ac8be5 (diff)
libdw: Reject DW_OP_implicit_value in CFI.
When we encounter a DW_OP_implicit_value we call store_implicit_value () which will try to store the value as part of the Dwarf dbg. But if we are examining CFI there will be no Dwarf dbg. And DW_OP_implicit_value should not be part of CFI. So explicitly reject it in store_implicit_value if dbg is NULL. Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libdw')
-rw-r--r--libdw/ChangeLog5
-rw-r--r--libdw/dwarf_getlocation.c2
2 files changed, 7 insertions, 0 deletions
diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index aaa62960..22fdab3d 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,8 @@
+2019-04-27 Mark Wielaard <mark@klomp.org>
+
+ * dwarf_getlocation.c (store_implicit_value): Check dbg isn't
+ NULL.
+
2019-02-02 Mark Wielaard <mark@klomp.org>
* dwarf_nextcu.c (__libdw_next_unit): Define bytes_end.
diff --git a/libdw/dwarf_getlocation.c b/libdw/dwarf_getlocation.c
index fc59a2ab..ae3f511e 100644
--- a/libdw/dwarf_getlocation.c
+++ b/libdw/dwarf_getlocation.c
@@ -125,6 +125,8 @@ loc_compare (const void *p1, const void *p2)
static int
store_implicit_value (Dwarf *dbg, void **cache, Dwarf_Op *op)
{
+ if (dbg == NULL)
+ return -1;
struct loc_block_s *block = libdw_alloc (dbg, struct loc_block_s,
sizeof (struct loc_block_s), 1);
const unsigned char *data = (const unsigned char *) (uintptr_t) op->number2;