From ca9c676099aafaa371abeadffcdbb96d5ed3a674 Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Wed, 7 Sep 2016 21:53:57 -0700 Subject: [PATCH] ContextHubService: Avoid null pointer dereference We stop calling closeLoadTxn() with a nullptr, so we won't crash. Bug: 31354170 Change-Id: Iebec9ff90a12b350811c24886917f084de88a7d5 --- core/jni/android_hardware_location_ContextHubService.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/jni/android_hardware_location_ContextHubService.cpp b/core/jni/android_hardware_location_ContextHubService.cpp index 36444102fb070..884d8ea3e3a66 100644 --- a/core/jni/android_hardware_location_ContextHubService.cpp +++ b/core/jni/android_hardware_location_ContextHubService.cpp @@ -1165,7 +1165,8 @@ static jint nativeSendMessage(JNIEnv *env, jobject instance, jintArray header_, if (retVal != 0) { ALOGD("Send Message failure - %d", retVal); if (msgType == CONTEXT_HUB_LOAD_APP) { - closeLoadTxn(false, nullptr); + jint ignored; + closeLoadTxn(false, &ignored); } else if (msgType == CONTEXT_HUB_UNLOAD_APP) { closeUnloadTxn(false); }