Dear list,

the following config line causes dnsmasq to crash:

> server=//local.domain/192.168.0.16

The attached patch fixes this issue.

Best regards,
Dominik
From 9010dde157118a94bdfffb5a6ba32e50cd879032 Mon Sep 17 00:00:00 2001
From: Dominik DL6ER <dl...@dl6er.de>
Date: Sat, 18 Jan 2020 14:33:01 +0100
Subject: [PATCH] Do not try to measure length of NULL pointer. This avoids a
 crash for empty domains in server=//... configurations.
---
 src/network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/network.c b/src/network.c
index e656ceb..be678ae 100644
--- a/src/network.c
+++ b/src/network.c
@@ -1531,7 +1531,7 @@ void check_servers(void)
 #endif
 	      if (!(serv->flags & SERV_HAS_DOMAIN))
 		s1 = _("unqualified"), s2 = _("names");
-	      else if (strlen(serv->domain) == 0)
+	      else if (serv->domain == NULL || strlen(serv->domain) == 0)
 		s1 = _("default"), s2 = "";
 	      else
 		s1 = _("domain"), s2 = serv->domain;
-- 
2.11.0

_______________________________________________
Dnsmasq-discuss mailing list
Dnsmasq-discuss@lists.thekelleys.org.uk
http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss

Reply via email to