Filter out invalid characters in domain names.
diff --git a/src/dnssec.c b/src/dnssec.c
index 4cf9503..c5ba5f4 100644
--- a/src/dnssec.c
+++ b/src/dnssec.c
@@ -93,6 +93,8 @@
       while (count-- >= 0 && rr < end)
         {
           *buf = *rr++;
+          if (!isascii(*buf) || iscntrl(*buf) || *buf == '.')
+            return 0;
           if (*buf >= 'A' && *buf <= 'Z')
             *buf += 'a' - 'A';
           buf++;