From dfc01cd3a4f3d74f900f4c27ef1a942b7329c7ce Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Tue, 3 Jan 2023 09:33:31 +0100 Subject: [PATCH] Fix crash when getting IP address (#17576) --- tasmota/tasmota_support/support_wifi.ino | 2 +- tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasmota/tasmota_support/support_wifi.ino b/tasmota/tasmota_support/support_wifi.ino index 1baa6652a..6d946e3cd 100644 --- a/tasmota/tasmota_support/support_wifi.ino +++ b/tasmota/tasmota_support/support_wifi.ino @@ -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) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino b/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino index a34c8cf0b..b9d795759 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_82_esp32_ethernet.ino @@ -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