mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-16 20:16:37 +00:00

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.
23 lines
732 B
C
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}}
|
|
}
|