Skip to content

Commit 93119eb

Browse files
author
Dominika Maziec
committed
ESP8266Interface buffer null-terminated and parameters of scan function in correct order
1 parent 979e1f0 commit 93119eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/wifi/esp8266-driver/ESP8266Interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ int ESP8266Interface::set_credentials(const char *ssid, const char *pass, nsapi_
319319
if (ssid_length > 0
320320
&& ssid_length <= ESP8266_SSID_MAX_LENGTH) {
321321
memset(ap_ssid, 0, sizeof(ap_ssid));
322-
strncpy(ap_ssid, ssid, sizeof(ap_ssid));
322+
strncpy(ap_ssid, ssid, ESP8266_SSID_MAX_LENGTH);
323323
} else {
324324
return NSAPI_ERROR_PARAMETER;
325325
}
@@ -438,7 +438,7 @@ int ESP8266Interface::scan(WiFiAccessPoint *res, unsigned count, scan_mode mode,
438438
}
439439

440440
return _esp.scan(res, count, (mode == SCANMODE_ACTIVE ? ESP8266::SCANMODE_ACTIVE : ESP8266::SCANMODE_PASSIVE),
441-
t_min, t_max);
441+
t_max, t_min);
442442
}
443443

444444
bool ESP8266Interface::_get_firmware_ok()

0 commit comments

Comments
 (0)