From 9eef54be2f3ab5f425438a7e3abd4038d73adb41 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sat, 16 Feb 2013 18:34:14 +0300 Subject: [PATCH] parse_call_math: fix segfault Test to see if there actually is an argument where we expected to find one. Signed-off-by: Dan Carpenter --- smatch_parse_call_math.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/smatch_parse_call_math.c b/smatch_parse_call_math.c index de6f97cc..1da87de3 100644 --- a/smatch_parse_call_math.c +++ b/smatch_parse_call_math.c @@ -260,6 +260,9 @@ static int format_expr_helper(char *buf, int remaining, struct expression *expr) int ret; char *cur; + if (!expr) + return 0; + cur = buf; if (expr->type == EXPR_BINOP) { -- 2.11.4.GIT