From cab6b64be82dbeac96a006d6c8cd66fc407eff0d Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 14 Feb 2013 15:07:58 +0300 Subject: [PATCH] rosenberg: fix crash parsing different functions with the same name We load all the functions we are interested in into a list and we expect to find the arguments in the right place. But sometimes there are functions with the same name as one we are interested in but no arguments. Signed-off-by: Dan Carpenter --- check_rosenberg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/check_rosenberg.c b/check_rosenberg.c index 1c58aa47..c2f802e1 100644 --- a/check_rosenberg.c +++ b/check_rosenberg.c @@ -79,6 +79,8 @@ static void match_clear(const char *fn, struct expression *expr, void *_arg_no) int arg_no = PTR_INT(_arg_no); ptr = get_argument_from_call_expr(expr->args, arg_no); + if (!ptr) + return; if (ptr->type != EXPR_PREOP || ptr->op != '&') return; ptr = strip_expr(ptr->unop); -- 2.11.4.GIT