From 4897561879da50f2d3b8849435ab2b559dd11cd7 Mon Sep 17 00:00:00 2001 From: panliming-tuya Date: Wed, 21 Sep 2022 21:47:07 +0800 Subject: [PATCH] Fix: Android commissioning complete crash (#22747) When the Thread device is set up first, operationalDatasetBytes has been released, but has not been assigned to nullptr. After setup a non-Thread device, ReleaseByteArrayElements will be called again, and a crash will occur --- src/controller/java/AndroidDeviceControllerWrapper.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controller/java/AndroidDeviceControllerWrapper.cpp b/src/controller/java/AndroidDeviceControllerWrapper.cpp index f737e9bae81a34..922ad281936e00 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.cpp +++ b/src/controller/java/AndroidDeviceControllerWrapper.cpp @@ -439,6 +439,7 @@ void AndroidDeviceControllerWrapper::OnCommissioningComplete(NodeId deviceId, CH { env->ReleaseByteArrayElements(operationalDatasetBytes, operationalDataset, 0); env->DeleteGlobalRef(operationalDatasetBytes); + operationalDatasetBytes = nullptr; } }