Skip to content

Commit 0adb47b

Browse files
Fixed ESP8266 nullpointer dereference.
1 parent 5f495db commit 0adb47b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

components/wifi/esp8266-driver/ESP8266/ESP8266.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,9 @@ nsapi_error_t ESP8266::open_tcp(int id, const char *addr, int port, int keepaliv
557557
static const char *type = "TCP";
558558
bool done = false;
559559

560+
if (!addr) {
561+
return NSAPI_ERROR_PARAMETER;
562+
}
560563
_smutex.lock();
561564

562565
// process OOB so that _sock_i reflects the correct state of the socket

0 commit comments

Comments
 (0)