summaryrefslogtreecommitdiff
path: root/tests/test_strcpy_overwrite_under.c
blob: 24424709e0a54e6817c68cf8a624a5b2342d32e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#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);

  CHK_FAIL_START
  strcpy(buffer-1, buffer);
  CHK_FAIL_END

  puts(buffer);
  return ret;
}