I got a couple of dnsmasqd crash and on investigating I found the crash is due 
to accessing a NULL pointer.

I have a fix for this problem and attached with this mail.

Would you have any suggestion for this fix?



CR-57199: Fix dnsmasqd crash

From: Justin Jose <justin.j...@alliedtelesis.co.nz>

The crash is caused by accessing NULL pointer in hostname_isequal().
If any string is NULL return "not equal" without string comparison.

 src/util.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util.c b/src/util.c
index 6b193b7..b41d814 100644
--- a/src/util.c
+++ b/src/util.c
@@ -286,6 +286,9 @@ int hostname_isequal(char *a, char *b)
   unsigned int c1, c2;
+  if (a == NULL || b == NULL)
+    return 0;
   do {
     c1 = (unsigned char) *a++;
     c2 = (unsigned char) *b++;
Dnsmasq-discuss mailing list

Reply via email to