Mercurial > hg > CbC > CbC_llvm
view clang/test/Analysis/assume-controlled-environment.c @ 236:c4bab56944e8 llvm-original
LLVM 16
author | kono |
---|---|
date | Wed, 09 Nov 2022 17:45:10 +0900 |
parents | |
children |
line wrap: on
line source
// RUN: %clang_analyze_cc1 -verify=untrusted-env %s \ // RUN: -analyzer-checker=core \ // RUN: -analyzer-checker=alpha.security.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=alpha.security.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}} }