ESP8266WiFiScan does not terminate a 32 character long SSID #2200
Labels
component: libraries
type: bug
waiting for feedback
Waiting on additional info. If it's not received, the issue may be closed.
Milestone
ESP8266WiFiScan's
ssid(uint8_t i)
function assumesbss_info
's ssid member is null terminated with the following statement:return String(reinterpret_cast<const char*>(it->ssid));
Now, this works fine for any SSID less than 32 characters, as bss_info will have at least one null byte at the end. In the event that an SSID is exactly 32 characters,
bss_info->ssid
will not be null terminated, and the above line will include garbage in the String as it tries to find a null byte beyond the member.A memcpy of 32 bytes like below guarantees at most 32 characters are read and correctly terminated, and seems to work fine during my testing.
The text was updated successfully, but these errors were encountered: