Skip to content

Commit

Permalink
Merge branch 'fix/openthread_settings_out_of_range_issue' into 'master'
Browse files Browse the repository at this point in the history
fix(openthread): fix ot settings out of range issue

See merge request espressif/esp-idf!24631
  • Loading branch information
zwx1995esp committed Jul 10, 2023
2 parents cdaf1fd + 0d94cef commit 453dc6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/openthread/src/port/esp_openthread_settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ otError otPlatSettingsGet(otInstance *aInstance, uint16_t aKey, int aIndex, uint
if (ret != ESP_OK) {
return OT_ERROR_NOT_FOUND;
}
ret = nvs_get_blob(s_ot_nvs_handle, ot_nvs_key, aValue, (size_t *)aValueLength);
size_t length = *aValueLength;
ret = nvs_get_blob(s_ot_nvs_handle, ot_nvs_key, aValue, &length);
*aValueLength = (uint16_t) length;
ESP_RETURN_ON_FALSE((ret == ESP_OK), OT_ERROR_NOT_FOUND, OT_PLAT_LOG_TAG, "Data not found, err: %d", ret);
return OT_ERROR_NONE;
}
Expand Down

0 comments on commit 453dc6a

Please sign in to comment.