Skip to content

Commit

Permalink
Fix: Android commissioning complete crash (#22747)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
panliming-tuya authored and pull[bot] committed Sep 30, 2022
1 parent fe2de94 commit 1149772
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/controller/java/AndroidDeviceControllerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ void AndroidDeviceControllerWrapper::OnCommissioningComplete(NodeId deviceId, CH
{
env->ReleaseByteArrayElements(operationalDatasetBytes, operationalDataset, 0);
env->DeleteGlobalRef(operationalDatasetBytes);
operationalDatasetBytes = nullptr;
}
}

Expand Down

0 comments on commit 1149772

Please sign in to comment.