diff --git a/components/wpa_supplicant/src/eap_peer/eap_peap.c b/components/wpa_supplicant/src/eap_peer/eap_peap.c index b21ab6bac7..14bdf58423 100644 --- a/components/wpa_supplicant/src/eap_peer/eap_peap.c +++ b/components/wpa_supplicant/src/eap_peer/eap_peap.c @@ -1104,7 +1104,7 @@ static struct wpabuf * eap_peap_process(struct eap_sm *sm, void *priv, } if (tls_connection_established(sm->ssl_ctx, data->ssl.conn)) { - char label[24]; + char label[24] = {0}; wpa_printf(MSG_DEBUG, "EAP-PEAP: TLS done, proceed to Phase 2"); os_free(data->key_data); /* draft-josefsson-ppext-eap-tls-eap-05.txt diff --git a/components/wpa_supplicant/src/esp_supplicant/esp_wps.c b/components/wpa_supplicant/src/esp_supplicant/esp_wps.c index 2794acc89e..8133434e68 100644 --- a/components/wpa_supplicant/src/esp_supplicant/esp_wps.c +++ b/components/wpa_supplicant/src/esp_supplicant/esp_wps.c @@ -612,7 +612,7 @@ wps_parse_scan_result(struct wps_scan_ie *scan) } esp_wifi_enable_sta_privacy_internal(); os_memset(sm->config.ssid, 0, sizeof(sm->config.ssid)); - strncpy((char *)sm->config.ssid, (char *)&scan->ssid[2], (int)scan->ssid[1]); + os_memcpy(sm->config.ssid, (char *)&scan->ssid[2], (int)scan->ssid[1]); if (scan->bssid && memcmp(sm->config.bssid, scan->bssid, ETH_ALEN) != 0) { wpa_printf(MSG_INFO, "sm BSSid: "MACSTR " scan BSSID " MACSTR "\n", MAC2STR(sm->config.bssid), MAC2STR(scan->bssid));