Skip to content

Commit f4b63de

Browse files
committed
fix(webserver): Fixed a potential webserver compilation failure issue
- Closes #961
1 parent 3f85c77 commit f4b63de

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/at/src/at_web_server_cmd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ static esp_err_t at_get_wifi_info_from_json_str(char *buffer, wifi_sta_connect_c
11601160
ESP_LOGE(TAG, "ssid is too long");
11611161
return ESP_FAIL;
11621162
} else {
1163-
strncpy(ssid, item->valuestring, ssid_len);
1163+
strncpy(ssid, item->valuestring, sizeof(ssid) - 1);
11641164
}
11651165
}
11661166

@@ -1172,7 +1172,7 @@ static esp_err_t at_get_wifi_info_from_json_str(char *buffer, wifi_sta_connect_c
11721172
ESP_LOGE(TAG, "password is too long");
11731173
return ESP_FAIL;
11741174
} else {
1175-
strncpy(password, item->valuestring, password_len);
1175+
strncpy(password, item->valuestring, sizeof(password) - 1);
11761176
}
11771177
}
11781178
cJSON_Delete(root);

0 commit comments

Comments
 (0)