We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 99347ae + b6d4488 commit f902e0dCopy full SHA for f902e0d
ports/raspberrypi/common-hal/wifi/Radio.c
@@ -88,7 +88,7 @@ mp_obj_t common_hal_wifi_radio_get_hostname(wifi_radio_obj_t *self) {
88
89
void common_hal_wifi_radio_set_hostname(wifi_radio_obj_t *self, const char *hostname) {
90
assert(strlen(hostname) < MP_ARRAY_SIZE(self->hostname));
91
- memcpy(self->hostname, hostname, strlen(hostname));
+ strncpy(self->hostname, hostname, MP_ARRAY_SIZE(self->hostname) - 1);
92
netif_set_hostname(NETIF_STA, self->hostname);
93
netif_set_hostname(NETIF_AP, self->hostname);
94
}
0 commit comments