Merge pull request #11427 from dmaziec1/esp8266_coverity

ESP8266Interface buffer null-terminated and parameters of scan function in correct order
pull/11438/head
Martin Kojtal 2019-09-06 13:03:43 +02:00 committed by GitHub
commit 9da5c2227a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -319,7 +319,7 @@ int ESP8266Interface::set_credentials(const char *ssid, const char *pass, nsapi_
if (ssid_length > 0 if (ssid_length > 0
&& ssid_length <= ESP8266_SSID_MAX_LENGTH) { && ssid_length <= ESP8266_SSID_MAX_LENGTH) {
memset(ap_ssid, 0, sizeof(ap_ssid)); memset(ap_ssid, 0, sizeof(ap_ssid));
strncpy(ap_ssid, ssid, sizeof(ap_ssid)); strncpy(ap_ssid, ssid, ESP8266_SSID_MAX_LENGTH);
} else { } else {
return NSAPI_ERROR_PARAMETER; 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), 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() bool ESP8266Interface::_get_firmware_ok()