From 4d587f2f9a4c97cca5beefb230c76c2c2830da49 Mon Sep 17 00:00:00 2001 From: Nick Kralevich Date: Mon, 24 Aug 2015 10:51:38 -0700 Subject: [PATCH] libutils: Enable LOCAL_SANITIZE := integer Call abort() on undefined or sketchy integer behavior. Protects against integer overflow attacks. Change-Id: I475e5e9fb04160dd2d201e926ab2b897539f8bb6 --- libutils/Android.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libutils/Android.mk b/libutils/Android.mk index 8f829f39a..8226db25d 100644 --- a/libutils/Android.mk +++ b/libutils/Android.mk @@ -92,6 +92,8 @@ LOCAL_SHARED_LIBRARIES := \ libdl LOCAL_MODULE := libutils +LOCAL_CLANG := true +LOCAL_SANITIZE := integer include $(BUILD_STATIC_LIBRARY) # For the device, shared @@ -106,6 +108,8 @@ LOCAL_SHARED_LIBRARIES := \ liblog LOCAL_CFLAGS := -Werror +LOCAL_CLANG := true +LOCAL_SANITIZE := integer include $(BUILD_SHARED_LIBRARY)