summaryrefslogtreecommitdiffstats
path: root/usr.bin/ctfconv/parse.c
diff options
context:
space:
mode:
authorjsg <jsg@openbsd.org>2017-09-24 09:14:25 +0000
committerjsg <jsg@openbsd.org>2017-09-24 09:14:25 +0000
commitb62fc310ca2be79b9fd660554779ca6ee0010a5f (patch)
tree2e62b9f343b2baa1c11cbb0a078d6034cfdde2cf /usr.bin/ctfconv/parse.c
parentIgnore DW_FORM_strp with size larger than elf section buffer (diff)
downloadwireguard-openbsd-b62fc310ca2be79b9fd660554779ca6ee0010a5f.tar.xz
wireguard-openbsd-b62fc310ca2be79b9fd660554779ca6ee0010a5f.zip
Handle parse_base() returning NULL for DW_TAG_base_type to avoid
attemping to insert a NULL iterator leading to a NULL deref crash. Found with afl. ok mpi@
Diffstat (limited to 'usr.bin/ctfconv/parse.c')
-rw-r--r--usr.bin/ctfconv/parse.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ctfconv/parse.c b/usr.bin/ctfconv/parse.c
index 655b69fd729..ee49031f26c 100644
--- a/usr.bin/ctfconv/parse.c
+++ b/usr.bin/ctfconv/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.6 2017/09/24 08:44:14 jsg Exp $ */
+/* $OpenBSD: parse.c,v 1.7 2017/09/24 09:14:25 jsg Exp $ */
/*
* Copyright (c) 2016-2017 Martin Pieuchot
@@ -606,6 +606,8 @@ cu_parse(struct dwcu *dcu, struct itype_queue *cutq, struct ioff_tree *cuot)
break;
case DW_TAG_base_type:
it = parse_base(die, psz);
+ if (it == NULL)
+ continue;
break;
case DW_TAG_const_type:
it = parse_refers(die, psz, CTF_K_CONST);