hardened_malloc/test/simple-memory-corruption/delete_type_size_mismatch.cc

14 lines
200 B
C++
Raw Normal View History

2018-10-11 05:44:41 +00:00
#include <stdint.h>
struct foo {
uint64_t a, b, c, d;
};
__attribute__((optimize(0)))
int main(void) {
void *p = new char;
struct foo *c = (struct foo *)p;
delete c;
return 0;
}