From 392ecdbb5ba28edda46f885ed76a898625249bb4 Mon Sep 17 00:00:00 2001 From: Dominika Maziec Date: Thu, 5 Sep 2019 16:28:47 +0200 Subject: [PATCH] ESP8266Interface buffer null-terminated and parameters of scan function in correct order --- components/wifi/esp8266-driver/ESP8266Interface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/wifi/esp8266-driver/ESP8266Interface.cpp b/components/wifi/esp8266-driver/ESP8266Interface.cpp index 308de3c979..31deee4678 100644 --- a/components/wifi/esp8266-driver/ESP8266Interface.cpp +++ b/components/wifi/esp8266-driver/ESP8266Interface.cpp @@ -319,7 +319,7 @@ int ESP8266Interface::set_credentials(const char *ssid, const char *pass, nsapi_ if (ssid_length > 0 && ssid_length <= ESP8266_SSID_MAX_LENGTH) { memset(ap_ssid, 0, sizeof(ap_ssid)); - strncpy(ap_ssid, ssid, sizeof(ap_ssid)); + strncpy(ap_ssid, ssid, ESP8266_SSID_MAX_LENGTH); } else { return NSAPI_ERROR_PARAMETER; } @@ -438,7 +438,7 @@ int ESP8266Interface::scan(WiFiAccessPoint *res, unsigned count, scan_mode mode, } return _esp.scan(res, count, (mode == SCANMODE_ACTIVE ? ESP8266::SCANMODE_ACTIVE : ESP8266::SCANMODE_PASSIVE), - t_min, t_max); + t_max, t_min); } bool ESP8266Interface::_get_firmware_ok()