From 1112775187f67e05cfbe851f15b39c3ae3580e36 Mon Sep 17 00:00:00 2001 From: Kevin Coppock <47542933+g-coppock@users.noreply.github.com> Date: Thu, 13 Jan 2022 19:37:58 -0600 Subject: [PATCH] Ensure pointers in AndroidDeviceControllerWrapper are init to nullptr (#13557) Fixes #13556 Tested locally on an Android device on the reported code path without a crash. --- src/controller/java/AndroidDeviceControllerWrapper.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/controller/java/AndroidDeviceControllerWrapper.h b/src/controller/java/AndroidDeviceControllerWrapper.h index 02c26e1a1dcbe8..bddf910a077c7a 100644 --- a/src/controller/java/AndroidDeviceControllerWrapper.h +++ b/src/controller/java/AndroidDeviceControllerWrapper.h @@ -120,12 +120,12 @@ class AndroidDeviceControllerWrapper : public chip::Controller::DevicePairingDel bool mNodeIdRequested = false; // These fields allow us to release the string/byte array memory later. - jstring ssidStr; - jstring passwordStr; - const char * ssid; - const char * password; - jbyteArray operationalDatasetBytes; - jbyte * operationalDataset; + jstring ssidStr = nullptr; + jstring passwordStr = nullptr; + const char * ssid = nullptr; + const char * password = nullptr; + jbyteArray operationalDatasetBytes = nullptr; + jbyte * operationalDataset = nullptr; AndroidDeviceControllerWrapper(ChipDeviceControllerPtr controller) : mController(std::move(controller)) {