Fix crash when getting IP address (#17576)

This commit is contained in:
s-hadinger 2023-01-03 09:33:31 +01:00 committed by GitHub
parent 555b434361
commit dfc01cd3a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -639,7 +639,7 @@ bool DNSGetIP(IPAddress *ip, uint32_t idx)
if (ip != nullptr) { *ip = *ip_dns; }
return true;
}
*ip = *IP4_ADDR_ANY;
if (ip != nullptr) { *ip = *IP4_ADDR_ANY; }
return false;
}
String DNSGetIPStr(uint32_t idx)

View File

@ -243,7 +243,7 @@ bool EthernetGetIP(IPAddress *ip) {
if (ip != nullptr) { *ip = lip; }
return true;
}
*ip = IPAddress();
if (ip != nullptr) { *ip = IPAddress(); }
return false;
#else
// IPv4 only