1 2 3 4 5 6 7 8 9 10 11
#include <stdint.h> void *malloc (__SIZE_TYPE__); void free (void *); void test_binop2 () { char *p = (char *) malloc (4); int32_t *i = (int32_t *) (p + 3); *i = 20042; /* { dg-warning "heap-based buffer overflow" } */ free (p); }