[PATCH] D17447: Add check for CERT ENV33-C
Samuel Benzaquen via cfe-commits
cfe-commits at lists.llvm.org
Fri Feb 19 12:00:48 PST 2016
sbenza added inline comments.
================
Comment at: clang-tidy/cert/CommandProcessorCheck.cpp:36
@@ +35,3 @@
+ // is not a security risk by itself.
+ if (Fn->getName() == "system" && E->getNumArgs() == 1 &&
+ E->getArg(0)->isNullPointerConstant(*Result.Context,
----------------
You could move this into the matcher.
It could use the brand new nullPointerConstant()
unless(callExpr(callee(functionDecl(hasName("::system"))),
argumentCountIs(1), hasArgument(0, nullPointerConstant())))
Seems simpler.
http://reviews.llvm.org/D17447
More information about the cfe-commits
mailing list