From: Vsevolod Stakhov Date: Tue, 9 Jan 2018 11:38:07 +0000 (+0000) Subject: [Fix] Fix null callee case in clang plugin X-Git-Tag: 1.7.0~301 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c8a8f7dd4d91a9f7aa8b12367fa0f84e50829cc9;p=rspamd.git [Fix] Fix null callee case in clang plugin --- diff --git a/clang-plugin/printf_check.cc b/clang-plugin/printf_check.cc index 69174f6fb..9b4819d08 100644 --- a/clang-plugin/printf_check.cc +++ b/clang-plugin/printf_check.cc @@ -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 (E->getCalleeDecl ()); if (callee == NULL) { llvm::errs () << "Bad callee\n"; @@ -799,4 +803,4 @@ namespace rspamd { "_GError", "%e"); } -}; +}