From d5f3f73f51ed0718fdd56789848eed9c2f151444 Mon Sep 17 00:00:00 2001 From: Xu Si Yu Date: Tue, 12 Sep 2023 10:45:20 +0800 Subject: [PATCH] fix(openthread): copy the networkname with a null terminator --- components/openthread/src/esp_openthread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/openthread/src/esp_openthread.cpp b/components/openthread/src/esp_openthread.cpp index 5c35003da9..14a9aa43ca 100644 --- a/components/openthread/src/esp_openthread.cpp +++ b/components/openthread/src/esp_openthread.cpp @@ -112,7 +112,7 @@ esp_err_t esp_openthread_auto_start(otOperationalDatasetTlvs *datasetTlvs) dataset.mComponents.mIsPanIdPresent = true; len = strlen(CONFIG_OPENTHREAD_NETWORK_NAME); assert(len <= OT_NETWORK_NAME_MAX_SIZE); - memcpy(dataset.mNetworkName.m8, CONFIG_OPENTHREAD_NETWORK_NAME, len); + memcpy(dataset.mNetworkName.m8, CONFIG_OPENTHREAD_NETWORK_NAME, len + 1); dataset.mComponents.mIsNetworkNamePresent = true; // Extended Pan ID