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

Commit bfed73f0 authored by Satish Kodishala's avatar Satish Kodishala
Browse files

Return if sBluetoothHfpInterface pointer is NULL

Usecase:
During HFP initialisation.

Failure:
NULL pointer dereferencing, might cause crash

Rootcause:
Pointer 'sBluetoothHfpInterface' checked for NULL
and is dereferenced later.

Fix:
Check if the sBluetoothHfpInterface pointer is NULL
and return from initializeNative API before
dereferencing the pointer.

Fixes: 110066199
Change-Id: I99a159d9a2062b64689b6b0f694732d08fb7bd44
parent b21a3036
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -446,6 +446,7 @@ static void initializeNative(JNIEnv* env, jobject object, jint max_hf_clients,
  if (!sBluetoothHfpInterface) {
    ALOGW("%s: Failed to get Bluetooth Handsfree Interface", __func__);
    jniThrowIOException(env, EINVAL);
    return;
  }
  bt_status_t status =
      sBluetoothHfpInterface->Init(JniHeadsetCallbacks::GetInstance(),