Skip to content

Commit d738ad0

Browse files
committed
Handle case where wifiClient IP addresses may not be set
1 parent b72a0dc commit d738ad0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/arduino_homekit_server.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2987,6 +2987,13 @@ client_context_t* homekit_server_accept_client(homekit_server_t *server) {
29872987
delete wifiClient;
29882988
return NULL;
29892989
}
2990+
if (!wifiClient->localIP().isSet() ||
2991+
!wifiClient->remoteIP().isSet()) {
2992+
INFO("wifiClient creation error, IP address is not set");
2993+
wifiClient->stop();
2994+
delete wifiClient;
2995+
return NULL;
2996+
}
29902997
} else {
29912998
return NULL;
29922999
}

0 commit comments

Comments
 (0)