From b43a50f4edaf4c072de67615e5cfbc5bad4577e8 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 12 Sep 2013 12:43:19 +0300 Subject: [PATCH] helper: fix crashing bug This has problems parsing unions. The fix is not very beautiful but it doesn't make anything worse. Reported-by: Guenter Roeck Signed-off-by: Dan Carpenter --- smatch_helper.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/smatch_helper.c b/smatch_helper.c index 7f832f4f..93fd0ba5 100644 --- a/smatch_helper.c +++ b/smatch_helper.c @@ -122,7 +122,10 @@ static void __get_variable_from_expr(struct symbol **sym_ptr, char *buf, else append(buf, ".", len); - append(buf, expr->member->name, len); + if (expr->member && expr->member->name) + append(buf, expr->member->name, len); + else + append(buf, "unknown_member", len); return; case EXPR_SYMBOL: -- 2.11.4.GIT