diff options
Diffstat (limited to 'libc/bionic/malloc_common.cpp')
-rw-r--r-- | libc/bionic/malloc_common.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libc/bionic/malloc_common.cpp b/libc/bionic/malloc_common.cpp index c91efa0f0..9744968fc 100644 --- a/libc/bionic/malloc_common.cpp +++ b/libc/bionic/malloc_common.cpp @@ -326,13 +326,12 @@ extern "C" bool android_mallopt(int opcode, void* arg, size_t arg_size) { return LimitEnable(arg, arg_size); } if (opcode == M_INITIALIZE_GWP_ASAN) { - if (arg == nullptr || arg_size != sizeof(bool)) { + if (arg == nullptr || arg_size != sizeof(android_mallopt_gwp_asan_options_t)) { errno = EINVAL; return false; } - __libc_globals.mutate([&](libc_globals* globals) { - return MaybeInitGwpAsan(globals, *reinterpret_cast<bool*>(arg)); - }); + + return EnableGwpAsan(*reinterpret_cast<android_mallopt_gwp_asan_options_t*>(arg)); } errno = ENOTSUP; return false; |