summaryrefslogtreecommitdiffstats
path: root/test/Analysis/outofbound.c
blob: a866ad905b3bdf291218149e8a2dcbe511cd7b00 (plain)
1
2
3
4
5
6
7
// RUN: clang -cc1 -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s

char f1() {
  char* s = "abcd";
  char c = s[4]; // no-warning
  return s[5] + c; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
}
OpenPOWER on IntegriCloud