From 3498e86d8b8cbb89be316c19c09264ba5afd50be Mon Sep 17 00:00:00 2001 From: microDev <70126934+microDev1@users.noreply.github.com> Date: Wed, 21 Sep 2022 21:03:07 +0530 Subject: [PATCH] prevent crash when hostname is null --- components/mdns/mdns.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/mdns/mdns.c b/components/mdns/mdns.c index 4de991982..d005ba483 100644 --- a/components/mdns/mdns.c +++ b/components/mdns/mdns.c @@ -2801,7 +2801,8 @@ static int _mdns_check_aaaa_collision(esp_ip6_addr_t * ip, mdns_if_t tcpip_if) static bool _hostname_is_ours(const char * hostname) { - if (strcasecmp(hostname, _mdns_server->hostname) == 0) { + if (!_str_null_or_empty(_mdns_server->hostname) && + strcasecmp(hostname, _mdns_server->hostname) == 0) { return true; } mdns_host_item_t * host = _mdns_host_list;