llvm-project/clang/test/Analysis/assume-controlled-environment.c
Daniel Krupp f82fb06cd1
[analyzer] Moving TaintPropagation checker out of alpha (#67352)
This commit moves the **alpha.security.taint.TaintPropagation** and
**alpha.security.taint.GenericTaint** checkers to the **optin.taint**
optional package.

These checkers were stabilized and improved by recent commits thus 
they are ready for production use.
2024-09-26 14:00:13 +02:00

23 lines
732 B
C

// RUN: %clang_analyze_cc1 -verify=untrusted-env %s \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-checker=optin.taint \
// RUN: -analyzer-checker=debug.TaintTest
// RUN: %clang_analyze_cc1 -verify %s -DEXPECT_NO_WARNINGS \
// RUN: -analyzer-config assume-controlled-environment=true \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-checker=optin.taint \
// RUN: -analyzer-checker=debug.TaintTest
#ifdef EXPECT_NO_WARNINGS
// expected-no-diagnostics
#endif
char *getenv(const char *name);
void foo(void) {
char *p = getenv("FOO"); // untrusted-env-warning {{tainted}}
(void)p; // untrusted-env-warning {{tainted}}
}