blob: 6079f13231794f50700c1ea3609092bb38570532 [file] [log] [blame]
Ted Kremenekc5b4c0e2009-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 Kremenek9c497622009-07-23 21:34:35 +000018#include "llvm/Support/raw_ostream.h"
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +000019
20using namespace clang;
21
22namespace {
23class VISIBILITY_HIDDEN WalkAST : public StmtVisitor<WalkAST> {
Mike Stump11289f42009-09-09 15:08:12 +000024 BugReporter &BR;
Ted Kremenekd032fcc2009-08-28 00:08:09 +000025 IdentifierInfo *II_gets;
Ted Kremenekad5a6002009-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 Stump11289f42009-09-09 15:08:12 +000031
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +000032public:
Ted Kremenek6610c032009-07-23 22:29:41 +000033 WalkAST(BugReporter &br) : BR(br),
Ted Kremenekad5a6002009-09-02 02:47:41 +000034 II_gets(0), II_rand(), II_random(0), II_setid() {}
Mike Stump11289f42009-09-09 15:08:12 +000035
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +000036 // Statement visitor methods.
Ted Kremenek6610c032009-07-23 22:29:41 +000037 void VisitCallExpr(CallExpr *CE);
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +000038 void VisitForStmt(ForStmt *S);
Ted Kremenekd032fcc2009-08-28 00:08:09 +000039 void VisitCompoundStmt (CompoundStmt *S);
Ted Kremenek9c497622009-07-23 21:34:35 +000040 void VisitStmt(Stmt *S) { VisitChildren(S); }
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +000041
42 void VisitChildren(Stmt *S);
Mike Stump11289f42009-09-09 15:08:12 +000043
Ted Kremenek6610c032009-07-23 22:29:41 +000044 // Helpers.
45 IdentifierInfo *GetIdentifier(IdentifierInfo *& II, const char *str);
Mike Stump11289f42009-09-09 15:08:12 +000046
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +000047 // Checker-specific methods.
Ted Kremenek9c497622009-07-23 21:34:35 +000048 void CheckLoopConditionForFloat(const ForStmt *FS);
Ted Kremenek6610c032009-07-23 22:29:41 +000049 void CheckCall_gets(const CallExpr *CE, const FunctionDecl *FD);
Ted Kremenekad5a6002009-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 Kremenekd032fcc2009-08-28 00:08:09 +000052 void CheckUncheckedReturnValue(CallExpr *CE);
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +000053};
54} // end anonymous namespace
55
56//===----------------------------------------------------------------------===//
Ted Kremenek6610c032009-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 Stump11289f42009-09-09 15:08:12 +000063
64 return II;
Ted Kremenek6610c032009-07-23 22:29:41 +000065}
66
67//===----------------------------------------------------------------------===//
Ted Kremenekc5b4c0e2009-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 Kremenek6610c032009-07-23 22:29:41 +000077void WalkAST::VisitCallExpr(CallExpr *CE) {
78 if (const FunctionDecl *FD = CE->getDirectCallee()) {
Ted Kremenekad5a6002009-09-02 02:47:41 +000079 CheckCall_gets(CE, FD);
80 CheckCall_rand(CE, FD);
81 CheckCall_random(CE, FD);
Ted Kremenek6610c032009-07-23 22:29:41 +000082 }
Mike Stump11289f42009-09-09 15:08:12 +000083
Ted Kremenek6610c032009-07-23 22:29:41 +000084 // Recurse and check children.
85 VisitChildren(CE);
86}
87
Ted Kremenekd032fcc2009-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 Stump11289f42009-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 Kremenekd032fcc2009-08-28 00:08:09 +000095}
96
Ted Kremenek9c497622009-07-23 21:34:35 +000097void WalkAST::VisitForStmt(ForStmt *FS) {
Mike Stump11289f42009-09-09 15:08:12 +000098 CheckLoopConditionForFloat(FS);
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +000099
Ted Kremenek9c497622009-07-23 21:34:35 +0000100 // Recurse and check children.
101 VisitChildren(FS);
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +0000102}
103
104//===----------------------------------------------------------------------===//
Ted Kremenek9c497622009-07-23 21:34:35 +0000105// Check: floating poing variable used as loop counter.
Ted Kremenek70e55262009-07-23 21:44:18 +0000106// Originally: <rdar://problem/6336718>
107// Implements: CERT security coding advisory FLP-30.
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +0000108//===----------------------------------------------------------------------===//
109
Ted Kremenek9c497622009-07-23 21:34:35 +0000110static const DeclRefExpr*
111GetIncrementedVar(const Expr *expr, const VarDecl *x, const VarDecl *y) {
112 expr = expr->IgnoreParenCasts();
Mike Stump11289f42009-09-09 15:08:12 +0000113
114 if (const BinaryOperator *B = dyn_cast<BinaryOperator>(expr)) {
Ted Kremenek9c497622009-07-23 21:34:35 +0000115 if (!(B->isAssignmentOp() || B->isCompoundAssignmentOp() ||
116 B->getOpcode() == BinaryOperator::Comma))
117 return NULL;
Mike Stump11289f42009-09-09 15:08:12 +0000118
Ted Kremenek9c497622009-07-23 21:34:35 +0000119 if (const DeclRefExpr *lhs = GetIncrementedVar(B->getLHS(), x, y))
120 return lhs;
Mike Stump11289f42009-09-09 15:08:12 +0000121
Ted Kremenek9c497622009-07-23 21:34:35 +0000122 if (const DeclRefExpr *rhs = GetIncrementedVar(B->getRHS(), x, y))
123 return rhs;
Mike Stump11289f42009-09-09 15:08:12 +0000124
Ted Kremenek9c497622009-07-23 21:34:35 +0000125 return NULL;
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +0000126 }
Mike Stump11289f42009-09-09 15:08:12 +0000127
Ted Kremenek9c497622009-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 Stump11289f42009-09-09 15:08:12 +0000132
Ted Kremenek9c497622009-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 Kremenekc5b4c0e2009-07-23 01:07:19 +0000137 return NULL;
138}
139
Ted Kremenek9c497622009-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 Stump11289f42009-09-09 15:08:12 +0000147
Ted Kremenek9c497622009-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 Stump11289f42009-09-09 15:08:12 +0000153
Ted Kremenek9c497622009-07-23 21:34:35 +0000154 if (!increment)
155 return;
Mike Stump11289f42009-09-09 15:08:12 +0000156
Ted Kremenek9c497622009-07-23 21:34:35 +0000157 // Strip away '()' and casts.
158 condition = condition->IgnoreParenCasts();
159 increment = increment->IgnoreParenCasts();
Mike Stump11289f42009-09-09 15:08:12 +0000160
Ted Kremenek9c497622009-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 Stump11289f42009-09-09 15:08:12 +0000166
Ted Kremenekb9cb1132009-07-24 20:26:31 +0000167 // Is this a comparison?
168 if (!(B->isRelationalOp() || B->isEqualityOp()))
Ted Kremenek9c497622009-07-23 21:34:35 +0000169 return;
Mike Stump11289f42009-09-09 15:08:12 +0000170
Ted Kremenek9c497622009-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 Stump11289f42009-09-09 15:08:12 +0000174
Ted Kremenekb9cb1132009-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 Stump11289f42009-09-09 15:08:12 +0000178
Ted Kremenek9c497622009-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 Stump11289f42009-09-09 15:08:12 +0000184
Ted Kremenek9c497622009-07-23 21:34:35 +0000185 if (!vdLHS && !vdRHS)
Mike Stump11289f42009-09-09 15:08:12 +0000186 return;
187
Ted Kremenek9c497622009-07-23 21:34:35 +0000188 // Does either variable appear in increment?
189 const DeclRefExpr *drInc = GetIncrementedVar(increment, vdLHS, vdRHS);
Mike Stump11289f42009-09-09 15:08:12 +0000190
Ted Kremenek9c497622009-07-23 21:34:35 +0000191 if (!drInc)
192 return;
Mike Stump11289f42009-09-09 15:08:12 +0000193
Ted Kremenek9c497622009-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 Stump11289f42009-09-09 15:08:12 +0000198 llvm::SmallVector<SourceRange, 2> ranges;
Ted Kremenek9c497622009-07-23 21:34:35 +0000199 std::string sbuf;
200 llvm::raw_string_ostream os(sbuf);
Mike Stump11289f42009-09-09 15:08:12 +0000201
Ted Kremenek9c497622009-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 Stump11289f42009-09-09 15:08:12 +0000208
Ted Kremenek9c497622009-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 Kremenekc5b4c0e2009-07-23 01:07:19 +0000212}
213
214//===----------------------------------------------------------------------===//
Ted Kremenek6610c032009-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)
Zhongxing Xuf69973c2009-11-09 08:13:04 +0000218// CWE-242: Use of Inherently Dangerous Function
Ted Kremenek6610c032009-07-23 22:29:41 +0000219//===----------------------------------------------------------------------===//
220
221void WalkAST::CheckCall_gets(const CallExpr *CE, const FunctionDecl *FD) {
222 if (FD->getIdentifier() != GetIdentifier(II_gets, "gets"))
223 return;
Mike Stump11289f42009-09-09 15:08:12 +0000224
Ted Kremenek6610c032009-07-23 22:29:41 +0000225 const FunctionProtoType *FTP = dyn_cast<FunctionProtoType>(FD->getType());
226 if (!FTP)
227 return;
Mike Stump11289f42009-09-09 15:08:12 +0000228
Ted Kremenek6610c032009-07-23 22:29:41 +0000229 // Verify that the function takes a single argument.
230 if (FTP->getNumArgs() != 1)
231 return;
232
233 // Is the argument a 'char*'?
234 const PointerType *PT = dyn_cast<PointerType>(FTP->getArgType(0));
235 if (!PT)
236 return;
Mike Stump11289f42009-09-09 15:08:12 +0000237
Ted Kremenek6610c032009-07-23 22:29:41 +0000238 if (PT->getPointeeType().getUnqualifiedType() != BR.getContext().CharTy)
239 return;
Mike Stump11289f42009-09-09 15:08:12 +0000240
Ted Kremenek6610c032009-07-23 22:29:41 +0000241 // Issue a warning.
242 SourceRange R = CE->getCallee()->getSourceRange();
243 BR.EmitBasicReport("Potential buffer overflow in call to 'gets'",
244 "Security",
245 "Call to function 'gets' is extremely insecure as it can "
246 "always result in a buffer overflow",
247 CE->getLocStart(), &R, 1);
248}
249
250//===----------------------------------------------------------------------===//
Ted Kremenekad5a6002009-09-02 02:47:41 +0000251// Check: Linear congruent random number generators should not be used
252// Originally: <rdar://problem/63371000>
253// CWE-338: Use of cryptographically weak prng
254//===----------------------------------------------------------------------===//
255
256void WalkAST::CheckCall_rand(const CallExpr *CE, const FunctionDecl *FD) {
257 if (II_rand[0] == NULL) {
258 // This check applies to these functions
259 static const char * const identifiers[num_rands] = {
260 "drand48", "erand48", "jrand48", "lrand48", "mrand48", "nrand48",
261 "lcong48",
262 "rand", "rand_r"
263 };
Mike Stump11289f42009-09-09 15:08:12 +0000264
Ted Kremenekad5a6002009-09-02 02:47:41 +0000265 for (size_t i = 0; i < num_rands; i++)
Mike Stump11289f42009-09-09 15:08:12 +0000266 II_rand[i] = &BR.getContext().Idents.get(identifiers[i]);
Ted Kremenekad5a6002009-09-02 02:47:41 +0000267 }
Mike Stump11289f42009-09-09 15:08:12 +0000268
Ted Kremenekad5a6002009-09-02 02:47:41 +0000269 const IdentifierInfo *id = FD->getIdentifier();
270 size_t identifierid;
271
272 for (identifierid = 0; identifierid < num_rands; identifierid++)
273 if (id == II_rand[identifierid])
274 break;
275
276 if (identifierid >= num_rands)
277 return;
Mike Stump11289f42009-09-09 15:08:12 +0000278
Ted Kremenekad5a6002009-09-02 02:47:41 +0000279 const FunctionProtoType *FTP = dyn_cast<FunctionProtoType>(FD->getType());
280 if (!FTP)
281 return;
Mike Stump11289f42009-09-09 15:08:12 +0000282
Ted Kremenekad5a6002009-09-02 02:47:41 +0000283 if (FTP->getNumArgs() == 1) {
284 // Is the argument an 'unsigned short *'?
285 // (Actually any integer type is allowed.)
286 const PointerType *PT = dyn_cast<PointerType>(FTP->getArgType(0));
287 if (!PT)
288 return;
Mike Stump11289f42009-09-09 15:08:12 +0000289
Ted Kremenekad5a6002009-09-02 02:47:41 +0000290 if (! PT->getPointeeType()->isIntegerType())
291 return;
292 }
Mike Stump11289f42009-09-09 15:08:12 +0000293 else if (FTP->getNumArgs() != 0)
Ted Kremenekad5a6002009-09-02 02:47:41 +0000294 return;
Mike Stump11289f42009-09-09 15:08:12 +0000295
Ted Kremenekad5a6002009-09-02 02:47:41 +0000296 // Issue a warning.
297 std::string buf1;
298 llvm::raw_string_ostream os1(buf1);
299 os1 << "'" << FD->getNameAsString() << "' is a poor random number generator";
300
301 std::string buf2;
302 llvm::raw_string_ostream os2(buf2);
303 os2 << "Function '" << FD->getNameAsString()
304 << "' is obsolete because it implements a poor random number generator."
305 << " Use 'arc4random' instead";
306
307 SourceRange R = CE->getCallee()->getSourceRange();
Mike Stump11289f42009-09-09 15:08:12 +0000308
Ted Kremenekad5a6002009-09-02 02:47:41 +0000309 BR.EmitBasicReport(os1.str().c_str(), "Security", os2.str().c_str(),
310 CE->getLocStart(), &R, 1);
311}
312
313//===----------------------------------------------------------------------===//
314// Check: 'random' should not be used
315// Originally: <rdar://problem/63371000>
316//===----------------------------------------------------------------------===//
317
318void WalkAST::CheckCall_random(const CallExpr *CE, const FunctionDecl *FD) {
319 if (FD->getIdentifier() != GetIdentifier(II_random, "random"))
320 return;
Mike Stump11289f42009-09-09 15:08:12 +0000321
Ted Kremenekad5a6002009-09-02 02:47:41 +0000322 const FunctionProtoType *FTP = dyn_cast<FunctionProtoType>(FD->getType());
323 if (!FTP)
324 return;
Mike Stump11289f42009-09-09 15:08:12 +0000325
Ted Kremenekad5a6002009-09-02 02:47:41 +0000326 // Verify that the function takes no argument.
327 if (FTP->getNumArgs() != 0)
328 return;
Mike Stump11289f42009-09-09 15:08:12 +0000329
Ted Kremenekad5a6002009-09-02 02:47:41 +0000330 // Issue a warning.
331 SourceRange R = CE->getCallee()->getSourceRange();
332 BR.EmitBasicReport("'random' is not a secure random number generator",
333 "Security",
334 "The 'random' function produces a sequence of values that "
335 "an adversary may be able to predict. Use 'arc4random' "
336 "instead",
337 CE->getLocStart(), &R, 1);
338}
339
340//===----------------------------------------------------------------------===//
Ted Kremenekd032fcc2009-08-28 00:08:09 +0000341// Check: Should check whether privileges are dropped successfully.
342// Originally: <rdar://problem/6337132>
343//===----------------------------------------------------------------------===//
344
345void WalkAST::CheckUncheckedReturnValue(CallExpr *CE) {
346 const FunctionDecl *FD = CE->getDirectCallee();
347 if (!FD)
348 return;
349
350 if (II_setid[0] == NULL) {
Ted Kremenekad5a6002009-09-02 02:47:41 +0000351 static const char * const identifiers[num_setids] = {
Ted Kremenekd032fcc2009-08-28 00:08:09 +0000352 "setuid", "setgid", "seteuid", "setegid",
353 "setreuid", "setregid"
354 };
Mike Stump11289f42009-09-09 15:08:12 +0000355
Ted Kremenekad5a6002009-09-02 02:47:41 +0000356 for (size_t i = 0; i < num_setids; i++)
Mike Stump11289f42009-09-09 15:08:12 +0000357 II_setid[i] = &BR.getContext().Idents.get(identifiers[i]);
Ted Kremenekd032fcc2009-08-28 00:08:09 +0000358 }
Mike Stump11289f42009-09-09 15:08:12 +0000359
Ted Kremenekd032fcc2009-08-28 00:08:09 +0000360 const IdentifierInfo *id = FD->getIdentifier();
361 size_t identifierid;
362
Ted Kremenekad5a6002009-09-02 02:47:41 +0000363 for (identifierid = 0; identifierid < num_setids; identifierid++)
Ted Kremenekd032fcc2009-08-28 00:08:09 +0000364 if (id == II_setid[identifierid])
365 break;
366
Ted Kremenekad5a6002009-09-02 02:47:41 +0000367 if (identifierid >= num_setids)
Ted Kremenekd032fcc2009-08-28 00:08:09 +0000368 return;
Mike Stump11289f42009-09-09 15:08:12 +0000369
Ted Kremenekd032fcc2009-08-28 00:08:09 +0000370 const FunctionProtoType *FTP = dyn_cast<FunctionProtoType>(FD->getType());
371 if (!FTP)
372 return;
Mike Stump11289f42009-09-09 15:08:12 +0000373
Ted Kremenekaeca0952009-08-28 00:24:55 +0000374 // Verify that the function takes one or two arguments (depending on
375 // the function).
Ted Kremenekd032fcc2009-08-28 00:08:09 +0000376 if (FTP->getNumArgs() != (identifierid < 4 ? 1 : 2))
377 return;
378
379 // The arguments must be integers.
380 for (unsigned i = 0; i < FTP->getNumArgs(); i++)
381 if (! FTP->getArgType(i)->isIntegerType())
382 return;
383
384 // Issue a warning.
385 std::string buf1;
386 llvm::raw_string_ostream os1(buf1);
387 os1 << "Return value is not checked in call to '" << FD->getNameAsString()
388 << "'";
389
390 std::string buf2;
391 llvm::raw_string_ostream os2(buf2);
392 os2 << "The return value from the call to '" << FD->getNameAsString()
393 << "' is not checked. If an error occurs in '"
394 << FD->getNameAsString()
395 << "', the following code may execute with unexpected privileges";
396
397 SourceRange R = CE->getCallee()->getSourceRange();
Mike Stump11289f42009-09-09 15:08:12 +0000398
Ted Kremenekd032fcc2009-08-28 00:08:09 +0000399 BR.EmitBasicReport(os1.str().c_str(), "Security", os2.str().c_str(),
400 CE->getLocStart(), &R, 1);
401}
402
403//===----------------------------------------------------------------------===//
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +0000404// Entry point for check.
405//===----------------------------------------------------------------------===//
406
Mike Stump11289f42009-09-09 15:08:12 +0000407void clang::CheckSecuritySyntaxOnly(const Decl *D, BugReporter &BR) {
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +0000408 WalkAST walker(BR);
Mike Stump11289f42009-09-09 15:08:12 +0000409 walker.Visit(D->getBody());
Ted Kremenekc5b4c0e2009-07-23 01:07:19 +0000410}