From b02f095b0f06333a4dc09d50d87a10559dc8e177 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 29 Feb 2012 21:40:58 +0300 Subject: [PATCH] flow: fix segfault on parse error The code below has a syntax error which caused a segfault. This adds a check to take care of it. void func(void) { u8 ac_to_queue[4]; ac_to_queue = { 0, 1, 2, 3 }; } Reported-by: Johannes Berg Signed-off-by: Dan Carpenter --- smatch_flow.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/smatch_flow.c b/smatch_flow.c index 460950ad..ed90775b 100644 --- a/smatch_flow.c +++ b/smatch_flow.c @@ -126,6 +126,9 @@ void __split_expr(struct expression *expr) case EXPR_ASSIGNMENT: { struct expression *tmp; + if (!expr->right) + break; + __pass_to_client(expr, RAW_ASSIGNMENT_HOOK); /* foo = !bar() */ -- 2.11.4.GIT