1 // Make sure the zones created by malloc_create_zone() are write-protected.
2 #include <malloc/malloc.h>
5 // RUN: %clangxx_asan %s -o %t
6 // RUN: ASAN_OPTIONS="abort_on_error=1" not --crash %run %t 2>&1 | FileCheck %s
9 void *pwn(malloc_zone_t
*unused_zone
, size_t unused_size
) {
15 malloc_zone_t
*zone
= malloc_create_zone(0, 0);
17 void *v
= malloc_zone_malloc(zone
, 1);