Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e7a2759

Browse files
authoredMar 23, 2021
Allow STA SSID length of 32
Fixes: #3218
1 parent 2ee66b5 commit e7a2759

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎libraries/WiFi/src/WiFiSTA.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ wl_status_t WiFiSTAClass::begin(const char* ssid, const char *passphrase, int32_
121121
return WL_CONNECT_FAILED;
122122
}
123123

124-
if(!ssid || *ssid == 0x00 || strlen(ssid) > 31) {
124+
if(!ssid || *ssid == 0x00 || strlen(ssid) > 32) {
125125
log_e("SSID too long or missing!");
126126
return WL_CONNECT_FAILED;
127127
}

1 commit comments

Comments
 (1)

dzsoni commented on Apr 3, 2021

@dzsoni

I think it's become dangerous. Then it is stored in wifi_sta_config_t struct , without null-termination.

Then... somebody try with this:
wifi_config_t conf;

esp_wifi_get_config(WIFI_IF_STA, &conf);

String ssid= String(reinterpret_cast<char*>(conf.sta.ssid));

conf.ssid only 31 char + '/0' temination
or
over reading to the conf.passsw?

Hm.

Please sign in to comment.