OSDN Git Service

Disable integer sanitizer in release function.
authorIvan Lozano <ivanlozano@google.com>
Wed, 8 Nov 2017 17:48:11 +0000 (09:48 -0800)
committerIvan Lozano <ivanlozano@google.com>
Wed, 8 Nov 2017 17:48:11 +0000 (09:48 -0800)
EphemeralStorage::release was causing an unsigned integer overflow on
boot due to the way the for loop is constructed. This function doesn't
need to be sanitized. This adds the no_sanitize attribute to the
function.

Bug: 30969751
Test: Compiles and device boots without runtime error.
Change-Id: Id28a2891624c1fe077fa5e27051540a39e33fe71

core/jni/hwbinder/EphemeralStorage.cpp

index 4996bc8..3b18f2b 100644 (file)
@@ -111,6 +111,7 @@ DEFINE_ALLOC_VECTOR_METHODS(Double,jdouble,Double)
                 break;                                                         \
             }
 
+__attribute__((no_sanitize("unsigned-integer-overflow")))
 void EphemeralStorage::release(JNIEnv *env) {
     for (size_t i = mItems.size(); i--;) {
         const Item &item = mItems[i];