Commit Diff
Diff:
b659b167c3fae91ffe8a9b28cbb8971696d10430
8d4adc5aba58af85442af2b2671a36967abccd11
Commit:
8d4adc5aba58af85442af2b2671a36967abccd11
Tree:
ed3c8ad3524fdb0c0475b318cc8e1b785e76f90f
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Sun Jul 19 07:09:02 2020 UTC
Message:
make a special shortcircuit in convert_name() for root (.)
blob - 5b744f49f54c83babfd5ec6b64087f7a5fb6291b
blob + e319856c9286021007d893b34004f341fb0fed8b
--- dnssec.c
+++ dnssec.c
@@ -27,7 +27,7 @@
*/
/*
- * $Id: dnssec.c,v 1.30 2020/07/18 10:49:25 pjp Exp $
+ * $Id: dnssec.c,v 1.31 2020/07/19 07:09:02 pjp Exp $
*/
#include <sys/types.h>
@@ -508,6 +508,12 @@ convert_name(char *name, int namelen)
ret = calloc(namelen + 1, 1);
if (ret == NULL) {
return NULL;
+ }
+
+ /* short circuit root */
+ if (namelen == 1 && name[1] == '\0') {
+ ret[0] = '.';
+ return (ret);
}
memcpy(ret, name + 1, namelen - 1);
repomaster@centroid.eu