From b8fad4bcd02210912de8cbdefcd77e9ca743a575 Mon Sep 17 00:00:00 2001 From: Davidson Francis Date: Mon, 11 May 2020 00:06:20 -0300 Subject: show-parse: null pointer dereference in do_show_type() In do_show_type() the first if statement allows passing null pointers, which can cause a null pointer dereference in some cases, which I believe is not the desired behavior. Fix this by changing the first if statement comparison. Signed-off-by: Davidson Francis Signed-off-by: Luc Van Oostenryck --- show-parse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/show-parse.c b/show-parse.c index 044465e9..8a145b88 100644 --- a/show-parse.c +++ b/show-parse.c @@ -292,7 +292,7 @@ static void do_show_type(struct symbol *sym, struct type_name *name) int fouled = 0; deeper: - if (!sym || (sym->type != SYM_NODE && sym->type != SYM_ARRAY && + if (sym && (sym->type != SYM_NODE && sym->type != SYM_ARRAY && sym->type != SYM_BITFIELD)) { const char *s; size_t len; -- cgit 1.2.3-korg