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 <dl6er@dl6er.de>
This commit is contained in:
DL6ER authored and Simon Kelley committed 2026-10-21 22:06:58 +01:00
1 parent 738c049988
commit a570a139d5
1 file changed
+1 -1
+1 -1
View File
@@ -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;