From b62fc310ca2be79b9fd660554779ca6ee0010a5f Mon Sep 17 00:00:00 2001 From: jsg Date: Sun, 24 Sep 2017 09:14:25 +0000 Subject: 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@ --- usr.bin/ctfconv/parse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr.bin/ctfconv/parse.c') 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); -- cgit v1.2.3-59-g8ed1b