aboutsummaryrefslogtreecommitdiff
path: root/src/dns
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-05-13 21:17:12 +0200
committerChristian Grothoff <christian@grothoff.org>2018-05-13 21:17:12 +0200
commit98ac2b34f979cf10da24c984e690dabf7b34794b (patch)
treeed4fd15409066b5403f02c23aab9e14b179bc874 /src/dns
parentfa2978883e1585b1eeff3a22b7a9b4f174a45ca3 (diff)
downloadgnunet-98ac2b34f979cf10da24c984e690dabf7b34794b.tar.gz
gnunet-98ac2b34f979cf10da24c984e690dabf7b34794b.zip
add some extra GNS-record well-formedness checks if logging is enabled
Diffstat (limited to 'src/dns')
-rw-r--r--src/dns/dnsparser.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/dns/dnsparser.c b/src/dns/dnsparser.c
index 7e200ee7c..6f9a24b7e 100644
--- a/src/dns/dnsparser.c
+++ b/src/dns/dnsparser.c
@@ -815,7 +815,9 @@ GNUNET_DNSPARSER_builder_add_name (char *dst,
815 return GNUNET_SYSERR; 815 return GNUNET_SYSERR;
816 816
817 if (IDNA_SUCCESS != 817 if (IDNA_SUCCESS !=
818 (rc = idna_to_ascii_8z (name, &idna_start, IDNA_ALLOW_UNASSIGNED))) 818 (rc = idna_to_ascii_8z (name,
819 &idna_start,
820 IDNA_ALLOW_UNASSIGNED)))
819 { 821 {
820 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 822 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
821 _("Failed to convert UTF-8 name `%s' to DNS IDNA format: %s\n"), 823 _("Failed to convert UTF-8 name `%s' to DNS IDNA format: %s\n"),
@@ -841,7 +843,9 @@ GNUNET_DNSPARSER_builder_add_name (char *dst,
841 goto fail; /* segment too long or empty */ 843 goto fail; /* segment too long or empty */
842 } 844 }
843 dst[pos++] = (char) (uint8_t) len; 845 dst[pos++] = (char) (uint8_t) len;
844 GNUNET_memcpy (&dst[pos], idna_name, len); 846 GNUNET_memcpy (&dst[pos],
847 idna_name,
848 len);
845 pos += len; 849 pos += len;
846 idna_name += len + 1; /* also skip dot */ 850 idna_name += len + 1; /* also skip dot */
847 } 851 }