From 56f06239301b512d0af55fe98b6e57f86884fce7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Tue, 6 Mar 2018 23:13:32 +0000 Subject: [PATCH] Allow trailing dot in CNAME. I got reported bug in Fedora [1], that cname is broken in new releases. At first I though this was false report, but there is still new regression in cname handling. Before, it accepted alias with trailing dot. Not it would accept only target, but not alias. cname=alias.,target is no longer valid. The issue is it will count size to skip after canonicalize. If that ignores trailing dot, next name would be "". And that is invalid and refused, dnsmasq refuses to start. I also think that any whitespace like tab should be possible after comma. So this fixes also 30858e3b9b12500825a5dc4cd67902c3201c1b25. --- src/option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/option.c b/src/option.c index edd0e62..482e501 100644 --- a/src/option.c +++ b/src/option.c @@ -3856,6 +3856,7 @@ err: while (arg != last) { + int arglen = strlen(arg); alias = canonicalise_opt(arg); if (!alias || !target) @@ -3871,7 +3872,7 @@ err: new->target = target; new->ttl = ttl; - for (arg += strlen(arg)+1; *arg == ' '; arg++); + for (arg += arglen+1; *arg && isspace(*arg); arg++); } break;