]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix null callee case in clang plugin
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 9 Jan 2018 11:38:07 +0000 (11:38 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 9 Jan 2018 18:41:43 +0000 (18:41 +0000)
clang-plugin/printf_check.cc

index 69174f6fb72476e4dbe22fcc48204ca24fb298ad..9b4819d08fbe66a5788f3cb9239edbf48015daa4 100644 (file)
@@ -375,6 +375,10 @@ namespace rspamd {
 
                bool VisitCallExpr (CallExpr *E)
                {
+                       if (E->getCalleeDecl () == nullptr) {
+                               llvm::errs () << "Bad callee\n";
+                               return false;
+                       }
                        auto callee = dyn_cast<NamedDecl> (E->getCalleeDecl ());
                        if (callee == NULL) {
                                llvm::errs () << "Bad callee\n";
@@ -799,4 +803,4 @@ namespace rspamd {
                                "_GError",
                                "%e");
        }
-};
+}