blob: 9f0d059cb66e9533509556a25935a168fa0df344 [file] [log] [blame]
Ted Kremenekdbfb5f82009-07-23 01:07:19 +00001//==- CheckSecuritySyntaxOnly.cpp - Basic security checks --------*- C++ -*-==//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines a set of flow-insensitive security checks.
11//
12//===----------------------------------------------------------------------===//
13
14#include "clang/Analysis/PathSensitive/BugReporter.h"
15#include "clang/Analysis/LocalCheckers.h"
16#include "clang/AST/StmtVisitor.h"
17#include "llvm/Support/Compiler.h"
Ted Kremenek8baf86d2009-07-23 21:34:35 +000018#include "llvm/Support/raw_ostream.h"
Ted Kremenekdbfb5f82009-07-23 01:07:19 +000019
20using namespace clang;
21
22namespace {
23class VISIBILITY_HIDDEN WalkAST : public StmtVisitor<WalkAST> {
Mike Stump1eb44332009-09-09 15:08:12 +000024 BugReporter &BR;
Ted Kremenek65a81a92009-08-28 00:08:09 +000025 IdentifierInfo *II_gets;
Ted Kremenek24650472009-09-02 02:47:41 +000026 enum { num_rands = 9 };
27 IdentifierInfo *II_rand[num_rands];
28 IdentifierInfo *II_random;
29 enum { num_setids = 6 };
30 IdentifierInfo *II_setid[num_setids];
Mike Stump1eb44332009-09-09 15:08:12 +000031
Ted Kremenekdbfb5f82009-07-23 01:07:19 +000032public:
Ted Kremenekefcbb152009-07-23 22:29:41 +000033 WalkAST(BugReporter &br) : BR(br),
Ted Kremenek24650472009-09-02 02:47:41 +000034 II_gets(0), II_rand(), II_random(0), II_setid() {}
Mike Stump1eb44332009-09-09 15:08:12 +000035
Ted Kremenekdbfb5f82009-07-23 01:07:19 +000036 // Statement visitor methods.
Ted Kremenekefcbb152009-07-23 22:29:41 +000037 void VisitCallExpr(CallExpr *CE);
Ted Kremenekdbfb5f82009-07-23 01:07:19 +000038 void VisitForStmt(ForStmt *S);
Ted Kremenek65a81a92009-08-28 00:08:09 +000039 void VisitCompoundStmt (CompoundStmt *S);
Ted Kremenek8baf86d2009-07-23 21:34:35 +000040 void VisitStmt(Stmt *S) { VisitChildren(S); }
Ted Kremenekdbfb5f82009-07-23 01:07:19 +000041
42 void VisitChildren(Stmt *S);
Mike Stump1eb44332009-09-09 15:08:12 +000043
Ted Kremenekefcbb152009-07-23 22:29:41 +000044 // Helpers.
45 IdentifierInfo *GetIdentifier(IdentifierInfo *& II, const char *str);
Mike Stump1eb44332009-09-09 15:08:12 +000046
Ted Kremenekdbfb5f82009-07-23 01:07:19 +000047 // Checker-specific methods.
Ted Kremenek8baf86d2009-07-23 21:34:35 +000048 void CheckLoopConditionForFloat(const ForStmt *FS);
Ted Kremenekefcbb152009-07-23 22:29:41 +000049 void CheckCall_gets(const CallExpr *CE, const FunctionDecl *FD);
Ted Kremenek24650472009-09-02 02:47:41 +000050 void CheckCall_rand(const CallExpr *CE, const FunctionDecl *FD);
51 void CheckCall_random(const CallExpr *CE, const FunctionDecl *FD);
Ted Kremenek65a81a92009-08-28 00:08:09 +000052 void CheckUncheckedReturnValue(CallExpr *CE);
Ted Kremenekdbfb5f82009-07-23 01:07:19 +000053};
54} // end anonymous namespace
55
56//===----------------------------------------------------------------------===//
Ted Kremenekefcbb152009-07-23 22:29:41 +000057// Helper methods.
58//===----------------------------------------------------------------------===//
59
60IdentifierInfo *WalkAST::GetIdentifier(IdentifierInfo *& II, const char *str) {
61 if (!II)
62 II = &BR.getContext().Idents.get(str);
Mike Stump1eb44332009-09-09 15:08:12 +000063
64 return II;
Ted Kremenekefcbb152009-07-23 22:29:41 +000065}
66
67//===----------------------------------------------------------------------===//
Ted Kremenekdbfb5f82009-07-23 01:07:19 +000068// AST walking.
69//===----------------------------------------------------------------------===//
70
71void WalkAST::VisitChildren(Stmt *S) {
72 for (Stmt::child_iterator I = S->child_begin(), E = S->child_end(); I!=E; ++I)
73 if (Stmt *child = *I)
74 Visit(child);
75}
76
Ted Kremenekefcbb152009-07-23 22:29:41 +000077void WalkAST::VisitCallExpr(CallExpr *CE) {
78 if (const FunctionDecl *FD = CE->getDirectCallee()) {
Ted Kremenek24650472009-09-02 02:47:41 +000079 CheckCall_gets(CE, FD);
80 CheckCall_rand(CE, FD);
81 CheckCall_random(CE, FD);
Ted Kremenekefcbb152009-07-23 22:29:41 +000082 }
Mike Stump1eb44332009-09-09 15:08:12 +000083
Ted Kremenekefcbb152009-07-23 22:29:41 +000084 // Recurse and check children.
85 VisitChildren(CE);
86}
87
Ted Kremenek65a81a92009-08-28 00:08:09 +000088void WalkAST::VisitCompoundStmt(CompoundStmt *S) {
89 for (Stmt::child_iterator I = S->child_begin(), E = S->child_end(); I!=E; ++I)
Mike Stump1eb44332009-09-09 15:08:12 +000090 if (Stmt *child = *I) {
91 if (CallExpr *CE = dyn_cast<CallExpr>(child))
92 CheckUncheckedReturnValue(CE);
93 Visit(child);
94 }
Ted Kremenek65a81a92009-08-28 00:08:09 +000095}
96
Ted Kremenek8baf86d2009-07-23 21:34:35 +000097void WalkAST::VisitForStmt(ForStmt *FS) {
Mike Stump1eb44332009-09-09 15:08:12 +000098 CheckLoopConditionForFloat(FS);
Ted Kremenekdbfb5f82009-07-23 01:07:19 +000099
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000100 // Recurse and check children.
101 VisitChildren(FS);
Ted Kremenekdbfb5f82009-07-23 01:07:19 +0000102}
103
104//===----------------------------------------------------------------------===//
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000105// Check: floating poing variable used as loop counter.
Ted Kremenek5abeb522009-07-23 21:44:18 +0000106// Originally: <rdar://problem/6336718>
107// Implements: CERT security coding advisory FLP-30.
Ted Kremenekdbfb5f82009-07-23 01:07:19 +0000108//===----------------------------------------------------------------------===//
109
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000110static const DeclRefExpr*
111GetIncrementedVar(const Expr *expr, const VarDecl *x, const VarDecl *y) {
112 expr = expr->IgnoreParenCasts();
Mike Stump1eb44332009-09-09 15:08:12 +0000113
114 if (const BinaryOperator *B = dyn_cast<BinaryOperator>(expr)) {
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000115 if (!(B->isAssignmentOp() || B->isCompoundAssignmentOp() ||
116 B->getOpcode() == BinaryOperator::Comma))
117 return NULL;
Mike Stump1eb44332009-09-09 15:08:12 +0000118
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000119 if (const DeclRefExpr *lhs = GetIncrementedVar(B->getLHS(), x, y))
120 return lhs;
Mike Stump1eb44332009-09-09 15:08:12 +0000121
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000122 if (const DeclRefExpr *rhs = GetIncrementedVar(B->getRHS(), x, y))
123 return rhs;
Mike Stump1eb44332009-09-09 15:08:12 +0000124
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000125 return NULL;
Ted Kremenekdbfb5f82009-07-23 01:07:19 +0000126 }
Mike Stump1eb44332009-09-09 15:08:12 +0000127
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000128 if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(expr)) {
129 const NamedDecl *ND = DR->getDecl();
130 return ND == x || ND == y ? DR : NULL;
131 }
Mike Stump1eb44332009-09-09 15:08:12 +0000132
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000133 if (const UnaryOperator *U = dyn_cast<UnaryOperator>(expr))
134 return U->isIncrementDecrementOp()
135 ? GetIncrementedVar(U->getSubExpr(), x, y) : NULL;
136
Ted Kremenekdbfb5f82009-07-23 01:07:19 +0000137 return NULL;
138}
139
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000140/// CheckLoopConditionForFloat - This check looks for 'for' statements that
141/// use a floating point variable as a loop counter.
142/// CERT: FLP30-C, FLP30-CPP.
143///
144void WalkAST::CheckLoopConditionForFloat(const ForStmt *FS) {
145 // Does the loop have a condition?
146 const Expr *condition = FS->getCond();
Mike Stump1eb44332009-09-09 15:08:12 +0000147
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000148 if (!condition)
149 return;
150
151 // Does the loop have an increment?
152 const Expr *increment = FS->getInc();
Mike Stump1eb44332009-09-09 15:08:12 +0000153
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000154 if (!increment)
155 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000156
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000157 // Strip away '()' and casts.
158 condition = condition->IgnoreParenCasts();
159 increment = increment->IgnoreParenCasts();
Mike Stump1eb44332009-09-09 15:08:12 +0000160
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000161 // Is the loop condition a comparison?
162 const BinaryOperator *B = dyn_cast<BinaryOperator>(condition);
163
164 if (!B)
165 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000166
Ted Kremenekcad9f412009-07-24 20:26:31 +0000167 // Is this a comparison?
168 if (!(B->isRelationalOp() || B->isEqualityOp()))
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000169 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000170
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000171 // Are we comparing variables?
172 const DeclRefExpr *drLHS = dyn_cast<DeclRefExpr>(B->getLHS()->IgnoreParens());
173 const DeclRefExpr *drRHS = dyn_cast<DeclRefExpr>(B->getRHS()->IgnoreParens());
Mike Stump1eb44332009-09-09 15:08:12 +0000174
Ted Kremenekcad9f412009-07-24 20:26:31 +0000175 // Does at least one of the variables have a floating point type?
176 drLHS = drLHS && drLHS->getType()->isFloatingType() ? drLHS : NULL;
177 drRHS = drRHS && drRHS->getType()->isFloatingType() ? drRHS : NULL;
Mike Stump1eb44332009-09-09 15:08:12 +0000178
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000179 if (!drLHS && !drRHS)
180 return;
181
182 const VarDecl *vdLHS = drLHS ? dyn_cast<VarDecl>(drLHS->getDecl()) : NULL;
183 const VarDecl *vdRHS = drRHS ? dyn_cast<VarDecl>(drRHS->getDecl()) : NULL;
Mike Stump1eb44332009-09-09 15:08:12 +0000184
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000185 if (!vdLHS && !vdRHS)
Mike Stump1eb44332009-09-09 15:08:12 +0000186 return;
187
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000188 // Does either variable appear in increment?
189 const DeclRefExpr *drInc = GetIncrementedVar(increment, vdLHS, vdRHS);
Mike Stump1eb44332009-09-09 15:08:12 +0000190
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000191 if (!drInc)
192 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000193
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000194 // Emit the error. First figure out which DeclRefExpr in the condition
195 // referenced the compared variable.
196 const DeclRefExpr *drCond = vdLHS == drInc->getDecl() ? drLHS : drRHS;
197
Mike Stump1eb44332009-09-09 15:08:12 +0000198 llvm::SmallVector<SourceRange, 2> ranges;
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000199 std::string sbuf;
200 llvm::raw_string_ostream os(sbuf);
Mike Stump1eb44332009-09-09 15:08:12 +0000201
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000202 os << "Variable '" << drCond->getDecl()->getNameAsCString()
203 << "' with floating point type '" << drCond->getType().getAsString()
204 << "' should not be used as a loop counter";
205
206 ranges.push_back(drCond->getSourceRange());
207 ranges.push_back(drInc->getSourceRange());
Mike Stump1eb44332009-09-09 15:08:12 +0000208
Ted Kremenek8baf86d2009-07-23 21:34:35 +0000209 const char *bugType = "Floating point variable used as loop counter";
210 BR.EmitBasicReport(bugType, "Security", os.str().c_str(),
211 FS->getLocStart(), ranges.data(), ranges.size());
Ted Kremenekdbfb5f82009-07-23 01:07:19 +0000212}
213
214//===----------------------------------------------------------------------===//
Ted Kremenekefcbb152009-07-23 22:29:41 +0000215// Check: Any use of 'gets' is insecure.
216// Originally: <rdar://problem/6335715>
217// Implements (part of): 300-BSI (buildsecurityin.us-cert.gov)
218//===----------------------------------------------------------------------===//
219
220void WalkAST::CheckCall_gets(const CallExpr *CE, const FunctionDecl *FD) {
221 if (FD->getIdentifier() != GetIdentifier(II_gets, "gets"))
222 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000223
Ted Kremenekefcbb152009-07-23 22:29:41 +0000224 const FunctionProtoType *FTP = dyn_cast<FunctionProtoType>(FD->getType());
225 if (!FTP)
226 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000227
Ted Kremenekefcbb152009-07-23 22:29:41 +0000228 // Verify that the function takes a single argument.
229 if (FTP->getNumArgs() != 1)
230 return;
231
232 // Is the argument a 'char*'?
233 const PointerType *PT = dyn_cast<PointerType>(FTP->getArgType(0));
234 if (!PT)
235 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000236
Ted Kremenekefcbb152009-07-23 22:29:41 +0000237 if (PT->getPointeeType().getUnqualifiedType() != BR.getContext().CharTy)
238 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000239
Ted Kremenekefcbb152009-07-23 22:29:41 +0000240 // Issue a warning.
241 SourceRange R = CE->getCallee()->getSourceRange();
242 BR.EmitBasicReport("Potential buffer overflow in call to 'gets'",
243 "Security",
244 "Call to function 'gets' is extremely insecure as it can "
245 "always result in a buffer overflow",
246 CE->getLocStart(), &R, 1);
247}
248
249//===----------------------------------------------------------------------===//
Ted Kremenek24650472009-09-02 02:47:41 +0000250// Check: Linear congruent random number generators should not be used
251// Originally: <rdar://problem/63371000>
252// CWE-338: Use of cryptographically weak prng
253//===----------------------------------------------------------------------===//
254
255void WalkAST::CheckCall_rand(const CallExpr *CE, const FunctionDecl *FD) {
256 if (II_rand[0] == NULL) {
257 // This check applies to these functions
258 static const char * const identifiers[num_rands] = {
259 "drand48", "erand48", "jrand48", "lrand48", "mrand48", "nrand48",
260 "lcong48",
261 "rand", "rand_r"
262 };
Mike Stump1eb44332009-09-09 15:08:12 +0000263
Ted Kremenek24650472009-09-02 02:47:41 +0000264 for (size_t i = 0; i < num_rands; i++)
Mike Stump1eb44332009-09-09 15:08:12 +0000265 II_rand[i] = &BR.getContext().Idents.get(identifiers[i]);
Ted Kremenek24650472009-09-02 02:47:41 +0000266 }
Mike Stump1eb44332009-09-09 15:08:12 +0000267
Ted Kremenek24650472009-09-02 02:47:41 +0000268 const IdentifierInfo *id = FD->getIdentifier();
269 size_t identifierid;
270
271 for (identifierid = 0; identifierid < num_rands; identifierid++)
272 if (id == II_rand[identifierid])
273 break;
274
275 if (identifierid >= num_rands)
276 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000277
Ted Kremenek24650472009-09-02 02:47:41 +0000278 const FunctionProtoType *FTP = dyn_cast<FunctionProtoType>(FD->getType());
279 if (!FTP)
280 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000281
Ted Kremenek24650472009-09-02 02:47:41 +0000282 if (FTP->getNumArgs() == 1) {
283 // Is the argument an 'unsigned short *'?
284 // (Actually any integer type is allowed.)
285 const PointerType *PT = dyn_cast<PointerType>(FTP->getArgType(0));
286 if (!PT)
287 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000288
Ted Kremenek24650472009-09-02 02:47:41 +0000289 if (! PT->getPointeeType()->isIntegerType())
290 return;
291 }
Mike Stump1eb44332009-09-09 15:08:12 +0000292 else if (FTP->getNumArgs() != 0)
Ted Kremenek24650472009-09-02 02:47:41 +0000293 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000294
Ted Kremenek24650472009-09-02 02:47:41 +0000295 // Issue a warning.
296 std::string buf1;
297 llvm::raw_string_ostream os1(buf1);
298 os1 << "'" << FD->getNameAsString() << "' is a poor random number generator";
299
300 std::string buf2;
301 llvm::raw_string_ostream os2(buf2);
302 os2 << "Function '" << FD->getNameAsString()
303 << "' is obsolete because it implements a poor random number generator."
304 << " Use 'arc4random' instead";
305
306 SourceRange R = CE->getCallee()->getSourceRange();
Mike Stump1eb44332009-09-09 15:08:12 +0000307
Ted Kremenek24650472009-09-02 02:47:41 +0000308 BR.EmitBasicReport(os1.str().c_str(), "Security", os2.str().c_str(),
309 CE->getLocStart(), &R, 1);
310}
311
312//===----------------------------------------------------------------------===//
313// Check: 'random' should not be used
314// Originally: <rdar://problem/63371000>
315//===----------------------------------------------------------------------===//
316
317void WalkAST::CheckCall_random(const CallExpr *CE, const FunctionDecl *FD) {
318 if (FD->getIdentifier() != GetIdentifier(II_random, "random"))
319 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000320
Ted Kremenek24650472009-09-02 02:47:41 +0000321 const FunctionProtoType *FTP = dyn_cast<FunctionProtoType>(FD->getType());
322 if (!FTP)
323 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000324
Ted Kremenek24650472009-09-02 02:47:41 +0000325 // Verify that the function takes no argument.
326 if (FTP->getNumArgs() != 0)
327 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000328
Ted Kremenek24650472009-09-02 02:47:41 +0000329 // Issue a warning.
330 SourceRange R = CE->getCallee()->getSourceRange();
331 BR.EmitBasicReport("'random' is not a secure random number generator",
332 "Security",
333 "The 'random' function produces a sequence of values that "
334 "an adversary may be able to predict. Use 'arc4random' "
335 "instead",
336 CE->getLocStart(), &R, 1);
337}
338
339//===----------------------------------------------------------------------===//
Ted Kremenek65a81a92009-08-28 00:08:09 +0000340// Check: Should check whether privileges are dropped successfully.
341// Originally: <rdar://problem/6337132>
342//===----------------------------------------------------------------------===//
343
344void WalkAST::CheckUncheckedReturnValue(CallExpr *CE) {
345 const FunctionDecl *FD = CE->getDirectCallee();
346 if (!FD)
347 return;
348
349 if (II_setid[0] == NULL) {
Ted Kremenek24650472009-09-02 02:47:41 +0000350 static const char * const identifiers[num_setids] = {
Ted Kremenek65a81a92009-08-28 00:08:09 +0000351 "setuid", "setgid", "seteuid", "setegid",
352 "setreuid", "setregid"
353 };
Mike Stump1eb44332009-09-09 15:08:12 +0000354
Ted Kremenek24650472009-09-02 02:47:41 +0000355 for (size_t i = 0; i < num_setids; i++)
Mike Stump1eb44332009-09-09 15:08:12 +0000356 II_setid[i] = &BR.getContext().Idents.get(identifiers[i]);
Ted Kremenek65a81a92009-08-28 00:08:09 +0000357 }
Mike Stump1eb44332009-09-09 15:08:12 +0000358
Ted Kremenek65a81a92009-08-28 00:08:09 +0000359 const IdentifierInfo *id = FD->getIdentifier();
360 size_t identifierid;
361
Ted Kremenek24650472009-09-02 02:47:41 +0000362 for (identifierid = 0; identifierid < num_setids; identifierid++)
Ted Kremenek65a81a92009-08-28 00:08:09 +0000363 if (id == II_setid[identifierid])
364 break;
365
Ted Kremenek24650472009-09-02 02:47:41 +0000366 if (identifierid >= num_setids)
Ted Kremenek65a81a92009-08-28 00:08:09 +0000367 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000368
Ted Kremenek65a81a92009-08-28 00:08:09 +0000369 const FunctionProtoType *FTP = dyn_cast<FunctionProtoType>(FD->getType());
370 if (!FTP)
371 return;
Mike Stump1eb44332009-09-09 15:08:12 +0000372
Ted Kremeneka8187832009-08-28 00:24:55 +0000373 // Verify that the function takes one or two arguments (depending on
374 // the function).
Ted Kremenek65a81a92009-08-28 00:08:09 +0000375 if (FTP->getNumArgs() != (identifierid < 4 ? 1 : 2))
376 return;
377
378 // The arguments must be integers.
379 for (unsigned i = 0; i < FTP->getNumArgs(); i++)
380 if (! FTP->getArgType(i)->isIntegerType())
381 return;
382
383 // Issue a warning.
384 std::string buf1;
385 llvm::raw_string_ostream os1(buf1);
386 os1 << "Return value is not checked in call to '" << FD->getNameAsString()
387 << "'";
388
389 std::string buf2;
390 llvm::raw_string_ostream os2(buf2);
391 os2 << "The return value from the call to '" << FD->getNameAsString()
392 << "' is not checked. If an error occurs in '"
393 << FD->getNameAsString()
394 << "', the following code may execute with unexpected privileges";
395
396 SourceRange R = CE->getCallee()->getSourceRange();
Mike Stump1eb44332009-09-09 15:08:12 +0000397
Ted Kremenek65a81a92009-08-28 00:08:09 +0000398 BR.EmitBasicReport(os1.str().c_str(), "Security", os2.str().c_str(),
399 CE->getLocStart(), &R, 1);
400}
401
402//===----------------------------------------------------------------------===//
Ted Kremenekdbfb5f82009-07-23 01:07:19 +0000403// Entry point for check.
404//===----------------------------------------------------------------------===//
405
Mike Stump1eb44332009-09-09 15:08:12 +0000406void clang::CheckSecuritySyntaxOnly(const Decl *D, BugReporter &BR) {
Ted Kremenekdbfb5f82009-07-23 01:07:19 +0000407 WalkAST walker(BR);
Mike Stump1eb44332009-09-09 15:08:12 +0000408 walker.Visit(D->getBody());
Ted Kremenekdbfb5f82009-07-23 01:07:19 +0000409}