Correct SSID copy length during WPS scan

This commit is contained in:
Kapil Gupta 2022-12-05 20:06:24 +05:30
parent c135695a18
commit 4a5f26d7fc
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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));