Anna Zaks | 9b0970f | 2011-11-16 19:58:17 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -analyze -analyzer-checker=experimental.security.taint,experimental.security.ArrayBoundV2 -verify %s |
2 | |||||
3 | int scanf(const char *restrict format, ...); | ||||
4 | int getchar(void); | ||||
5 | |||||
6 | #define BUFSIZE 10 | ||||
7 | |||||
8 | int Buffer[BUFSIZE]; | ||||
9 | void bufferFoo1(void) | ||||
10 | { | ||||
11 | int n; | ||||
12 | scanf("%d", &n); | ||||
13 | Buffer[n] = 1; // expected-warning {{Out of bound memory access }} | ||||
14 | } |