summaryrefslogtreecommitdiff
path: root/tests/test_strncpy_overwrite_under.c
blob: 568f414fd34919c03ad177e3da6e9fc288c403cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "common.h"

#include <string.h>

int main(int argc, char** argv) {
  char buffer[9] = {'A', 'A', 'A', 'A', 'B', 'B', 'B', 'B', '\0'};
  puts(buffer);

#if 0
  CHK_FAIL_START
  strncpy(buffer-1, buffer, 5);
  CHK_FAIL_END
#endif

  puts(buffer);
  return ret;
}