summaryrefslogtreecommitdiff
path: root/tests/test_strcpy_overwrite_over.c
blob: 924b34653e6f360f12dc11a19dada2fdbf433f30 (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;
}