Skip to content

Commit a00bc3d

Browse files
committed
Merge branch 'fix/fix_a_bug_of_web_server' into 'main'
fix(web): fix a bug in network name length check Closes TZ-1889 See merge request espressif/esp-thread-br!175
2 parents f60b7dc + 9e57ef9 commit a00bc3d

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

components/esp_ot_br_server/src/esp_br_web_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ static esp_err_t get_openthread_network_properties(otInstance *ins, thread_netwo
358358
ESP_RETURN_ON_FALSE(ins && network, ESP_FAIL, API_TAG, "Invalid instance or openthread network");
359359
char output[64] = "";
360360
sprintf(output, "%s", otThreadGetNetworkName(ins));
361-
ESP_RETURN_ON_FALSE((strlen(output) + 1) < sizeof(otNetworkName), ESP_FAIL, API_TAG, "Network name is too long");
361+
ESP_RETURN_ON_FALSE(strlen(output) < sizeof(otNetworkName), ESP_FAIL, API_TAG, "Network name is too long");
362362

363363
memcpy(&network->name, output, strlen(output) + 1); /* 1. name */
364364
network->panid = otLinkGetPanId(ins); /* 2. PANID */

examples/basic_thread_border_router/sdkconfig.defaults

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,8 @@ CONFIG_EXAMPLE_ETH_SPI_INT_GPIO=39
107107
CONFIG_EXAMPLE_ETH_PHY_RST_GPIO=40
108108
CONFIG_EXAMPLE_ETH_PHY_ADDR=1
109109
# end of Etherenet
110+
111+
#
112+
# http server
113+
#
114+
CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024

examples/m5stack_thread_border_router/sdkconfig.defaults

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,8 @@ CONFIG_LV_FONT_MONTSERRAT_32=y
117117
CONFIG_LV_FONT_MONTSERRAT_48=y
118118
CONFIG_LV_COLOR_16_SWAP=y
119119
CONFIG_LV_MEM_CUSTOM=y
120+
121+
#
122+
# http server
123+
#
124+
CONFIG_HTTPD_MAX_REQ_HDR_LEN=1024

0 commit comments

Comments
 (0)