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

Commit 168ecad4 authored by Scott Warner's avatar Scott Warner
Browse files

bluetooth: Prevent null pointer crashes in A2DP initNative

Change-Id: I91f555ae8f2311d80145fe6b33a6c93b1997ca66
parent 699645f5
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -221,7 +221,13 @@ static void initNative(JNIEnv *env, jobject object, jint maxA2dpConnections,
    const char *offload_capabilities;
    bt_status_t status;

    // Calling GetStringUTFChars with a null jstring can cause ART to crash
    if (offload_cap != NULL) {
        offload_capabilities = env->GetStringUTFChars(offload_cap, NULL);
    } else {
        offload_capabilities = NULL;
    }


    if ( (btInf = getBluetoothInterface()) == NULL) {
        ALOGE("Bluetooth module is not loaded");