From a570a139d5a715543e063e1e771a5a09e10b2a2b Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 21 Oct 2026 20:12:37 +0200 Subject: [PATCH] Don't add an empty CNAME alias for a space before a comma. split() replaces the comma with a space and then writes a NUL over every space before it, so "a.example ,target.example" becomes "a.example\0\0target.example". The --cname loop steps over one NUL and the following spaces only, stops on the second NUL and adds an empty alias, i.e., a CNAME for the root name. A second such entry is then rejected as "duplicate CNAME". Step over the NULs, too. Signed-off-by: DL6ER --- src/option.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/option.c b/src/option.c index 44bd522..012b14a 100644 --- a/src/option.c +++ b/src/option.c @@ -5046,7 +5046,7 @@ err: new->target = target; new->ttl = ttl; - for (arg += arglen+1; *arg && isspace((unsigned char)*arg); arg++); + for (arg += arglen+1; arg != last && (!*arg || isspace((unsigned char)*arg)); arg++); } break;