summaryrefslogtreecommitdiffstats
path: root/test/Analysis/diagnostics/sarif-diagnostics-taint-test.c
blob: 37ddc9df6a24493df3cedf6e4cfc72546c51d74e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// RUN: %clang_analyze_cc1 -analyzer-checker=alpha.security.taint,debug.TaintTest %s -verify -analyzer-output=sarif -o - | %diff_sarif %S/Inputs/expected-sarif/sarif-diagnostics-taint-test.c.sarif -
#include "../Inputs/system-header-simulator.h"

int atoi(const char *nptr);

void f(void) {
  char s[80];
  scanf("%s", s);
  int d = atoi(s); // expected-warning {{tainted}}
}

int main(void) {
  f();
  return 0;
}