1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

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.
This commit is contained in:
M Hightower 2020-04-17 14:19:46 -07:00 committed by GitHub
parent 9632e868d5
commit 503988132d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -367,7 +367,7 @@ uint16_t WiFiClient::remotePort()
IPAddress WiFiClient::localIP()
{
if (!_client)
if (!_client || !_client->getLocalAddress())
return IPAddress(0U);
return IPAddress(_client->getLocalAddress());
@ -389,7 +389,7 @@ void WiFiClient::stopAll()
}
void WiFiClient::stopAllExcept(WiFiClient* except)
void WiFiClient::stopAllExcept(WiFiClient* except)
{
for (WiFiClient* it = _s_first; it; it = it->_next) {
if (it != except) {