From e1266b141cf29d63db58f44f463f077c67c4e573 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Tue, 20 Feb 2018 22:31:39 +0300 Subject: [PATCH] db: fix a segfault parsing invalid code This only happens when we're parsing invalid code. Signed-off-by: Dan Carpenter --- smatch_db.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/smatch_db.c b/smatch_db.c index e8888286..c3079448 100644 --- a/smatch_db.c +++ b/smatch_db.c @@ -732,6 +732,8 @@ static void print_struct_members(struct expression *call, struct expression *exp int is_address = 0; expr = strip_expr(expr); + if (!expr) + return; if (expr->type == EXPR_PREOP && expr->op == '&') { expr = strip_expr(expr->unop); is_address = 1; -- 2.11.4.GIT