drd: Add a consistency check
[valgrind.git] / memcheck / tests / clo_redzone.c
blob5733ffae127d7f34b2050548af9d9580c6cdd082
1 #include <stdio.h>
2 #include <stdlib.h>
3 int main()
5 __attribute__((unused)) char *p = malloc (1);
6 char *b1 = malloc (128);
7 char *b2 = malloc (128);
8 fprintf (stderr, "b1 %p b2 %p\n", b1, b2);
10 // Try to land in b2 from b1, causing no error
11 // with the default redzone-size, but having
12 // an error with a bigger redzone-size.
13 // We need to choose a value which lands in b2
14 // on 32 bits and 64 bits.
15 b1[127 + 70] = 'a';
16 return 0;