diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 72cbb00bac1e32..76f1f7c989bce3 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -1720,6 +1720,7 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio if (status != CHIP_NO_ERROR) { actualCountryCodeSize = 2; + memset(countryCodeStr, 58, actualCountryCodeSize); ChipLogError(Controller, "Unable to find country code, defaulting to XX"); } chip::CharSpan countryCode(countryCodeStr, actualCountryCodeSize);