We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e667fb9 + 6291ca7 commit 4bf1b7cCopy full SHA for 4bf1b7c
1 file changed
components/pywpa2enterprise/modwpa2enterprise.c
@@ -22,7 +22,7 @@ STATIC mp_obj_t mod_wpa2enterprise_connect (mp_uint_t n_args, const mp_obj_t *ar
22
const char* aPassword = mp_obj_str_get_str(args[3]);
23
int phase2 = mp_obj_get_int(args[4]);
24
wifi_config_t wifi_config = {0};
25
- strncpy((char*) wifi_config.sta.ssid, aSsid, 32);
+ strlcpy((char*) wifi_config.sta.ssid, aSsid, sizeof(wifi_config.sta.ssid));
26
WIFI_SORT_ERRCHECK(esp_wifi_stop());
27
WIFI_SORT_ERRCHECK(esp_wifi_set_mode(WIFI_MODE_STA) );
28
WIFI_SORT_ERRCHECK(esp_wifi_set_config(WIFI_IF_STA, &wifi_config) );
0 commit comments