Fixed ESP8266 nullpointer dereference.

pull/12178/head
Tymoteusz Bloch 2019-12-31 14:49:01 +01:00
parent 5f495db06b
commit 0adb47b3aa
1 changed files with 3 additions and 0 deletions

View File

@ -557,6 +557,9 @@ nsapi_error_t ESP8266::open_tcp(int id, const char *addr, int port, int keepaliv
static const char *type = "TCP"; static const char *type = "TCP";
bool done = false; bool done = false;
if (!addr) {
return NSAPI_ERROR_PARAMETER;
}
_smutex.lock(); _smutex.lock();
// process OOB so that _sock_i reflects the correct state of the socket // process OOB so that _sock_i reflects the correct state of the socket