From 45eb228201137f975805eb79437eb363272df88d Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 25 Jan 2018 17:36:29 +0300 Subject: [PATCH] rosenberg: fix a crashing bug Presumably this only crashes on invalid code. 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 2613c351..2a9e3114 100644 --- a/check_rosenberg.c +++ b/check_rosenberg.c @@ -118,6 +118,8 @@ static int has_global_scope(struct expression *expr) if (expr->type != EXPR_SYMBOL) return FALSE; sym = expr->symbol; + if (!sym) + return FALSE; return toplevel(sym->scope); } -- 2.11.4.GIT