Fix wrong password same SSID (#5124)

When iterating through APlist from first to the last element, a corrected password for already known SSID is not used. Therefore, I propose to iterate from the back of the list. With iterating from the back through the vector, an already known SSID with a corrected password is used instead.
This commit is contained in:
Maurin 2021-06-10 12:19:58 +02:00 committed by GitHub
parent eca328e576
commit 5ae3e836f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -128,8 +128,8 @@ uint8_t WiFiMulti::run(uint32_t connectTimeout)
WiFi.getNetworkInfo(i, ssid_scan, sec_scan, rssi_scan, BSSID_scan, chan_scan);
bool known = false;
for(uint32_t x = 0; x < APlist.size(); x++) {
WifiAPlist_t entry = APlist[x];
for(uint32_t x = APlist.size() ; x > 0; x--) {
WifiAPlist_t entry = APlist[x-1];
if(ssid_scan == entry.ssid) { // SSID match
known = true;