Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd85d8b6 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Use our glibc memset_explicit() polyfill.

Change-Id: I0c67c5cd012ff0738196cc315b18348882657414
parent ca8fb985
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -86,11 +86,8 @@ static void ZeroizePrimitiveArray(JNIEnv* env, jclass clazz, jarray array, size_
    void* elems = env->GetPrimitiveArrayCritical(array, &isCopy);
    CHECK(!isCopy);

#ifdef __BIONIC__
    memset_explicit(elems, 0, buffer_size);
#else
    memset(elems, 0, buffer_size);
#endif

    // Clean the data cache so that the data gets zeroized in main memory right away.  Without this,
    // it might not be written to main memory until the cache line happens to be evicted.
    CleanDataCache(static_cast<const uint8_t*>(elems), buffer_size, cache_line_size);