mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 10:47:19 +02:00
fix(openthread): copy the networkname with a null terminator
This commit is contained in:
@ -112,7 +112,7 @@ esp_err_t esp_openthread_auto_start(otOperationalDatasetTlvs *datasetTlvs)
|
|||||||
dataset.mComponents.mIsPanIdPresent = true;
|
dataset.mComponents.mIsPanIdPresent = true;
|
||||||
len = strlen(CONFIG_OPENTHREAD_NETWORK_NAME);
|
len = strlen(CONFIG_OPENTHREAD_NETWORK_NAME);
|
||||||
assert(len <= OT_NETWORK_NAME_MAX_SIZE);
|
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;
|
dataset.mComponents.mIsNetworkNamePresent = true;
|
||||||
|
|
||||||
// Extended Pan ID
|
// Extended Pan ID
|
||||||
|
Reference in New Issue
Block a user