From d8157bc094569bee74976df2585d632f1793e226 Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Thu, 18 Apr 2019 16:32:42 -0700 Subject: HwBlob: s/malloc/calloc/ Since this blob is passed between processes. We could potentially only memset portions of the blob as it is written to. However, the JHwBlob API itself doesn't have to have writes in order (even though known usages of it do write in order). Because of this, keeping track of which bytes to pad would be too expensive. Bug: 131356202 Test: boot, hidl_test_java Change-Id: I48f4d7cb20c4bfe747dd323ae3744d323ad097c9 Merged-In: I48f4d7cb20c4bfe747dd323ae3744d323ad097c9 --- core/jni/android_os_HwBlob.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/jni/android_os_HwBlob.cpp b/core/jni/android_os_HwBlob.cpp index 8590ecf3bb19..d00f17ffee04 100644 --- a/core/jni/android_os_HwBlob.cpp +++ b/core/jni/android_os_HwBlob.cpp @@ -90,7 +90,7 @@ JHwBlob::JHwBlob(JNIEnv *env, jobject thiz, size_t size) mObject = env->NewWeakGlobalRef(thiz); if (size > 0) { - mBuffer = malloc(size); + mBuffer = calloc(size, 1); } } -- cgit v1.2.3-59-g8ed1b