brintos

brintos / llvm-project-archived public Read only

0
0
Text · 425 B · 7a3ca61 Raw
16 lines · c
1// RUN: %clang_analyze_cc1 -analyzer-checker=optin.taint,debug.TaintTest %s -verify -analyzer-output=sarif -o - | %normalize_sarif | diff -U1 -b %S/Inputs/expected-sarif/sarif-diagnostics-taint-test.c.sarif -2#include "../Inputs/system-header-simulator.h"3 4int atoi(const char *nptr);5 6void f(void) {7  char s[80];8  scanf("%s", s);9  int d = atoi(s); // expected-warning {{tainted}}10}11 12int main(void) {13  f();14  return 0;15}16