Skip to content

Commit 5039881

Browse files
authored
fNull pointer call from WiFiClient::localIP() to IPAddress (#7221)
Fixes exception 28 in IPAddress(const ipv4_addr* fw_addr); with null ip_addr pointer passed in by WiFiCient.cpp localIP(). I assumed that localIP() was called shortly after _pcb became null.
1 parent 9632e86 commit 5039881

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: libraries/ESP8266WiFi/src/WiFiClient.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ uint16_t WiFiClient::remotePort()
367367

368368
IPAddress WiFiClient::localIP()
369369
{
370-
if (!_client)
370+
if (!_client || !_client->getLocalAddress())
371371
return IPAddress(0U);
372372

373373
return IPAddress(_client->getLocalAddress());
@@ -389,7 +389,7 @@ void WiFiClient::stopAll()
389389
}
390390

391391

392-
void WiFiClient::stopAllExcept(WiFiClient* except)
392+
void WiFiClient::stopAllExcept(WiFiClient* except)
393393
{
394394
for (WiFiClient* it = _s_first; it; it = it->_next) {
395395
if (it != except) {

0 commit comments

Comments
 (0)