mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
lwip: Use strlcpy() instead of memcpy() to copy hostname to static buffer
This commit is contained in:
parent
3119f936ab
commit
da723ca11d
@ -726,7 +726,7 @@ esp_err_t tcpip_adapter_set_hostname(tcpip_adapter_if_t tcpip_if, const char *ho
|
||||
p_netif = esp_netif[tcpip_if];
|
||||
if (p_netif != NULL) {
|
||||
memset(hostinfo[tcpip_if], 0, sizeof(hostinfo[tcpip_if]));
|
||||
memcpy(hostinfo[tcpip_if], hostname, strlen(hostname));
|
||||
strlcpy(hostinfo[tcpip_if], hostname, sizeof(hostinfo[tcpip_if]));
|
||||
p_netif->hostname = hostinfo[tcpip_if];
|
||||
return ESP_OK;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user