From 8b0cafb1d8545fc06c5670f42b759b00d5c059b5 Mon Sep 17 00:00:00 2001 From: Sebastian Nadler Date: Sun, 19 Nov 2023 17:06:55 +0100 Subject: Fix URI record serialization issue --- src/plugin/gnsrecord/plugin_gnsrecord_dns.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugin/gnsrecord/plugin_gnsrecord_dns.c b/src/plugin/gnsrecord/plugin_gnsrecord_dns.c index 226481c5d..dde5ddcea 100644 --- a/src/plugin/gnsrecord/plugin_gnsrecord_dns.c +++ b/src/plugin/gnsrecord/plugin_gnsrecord_dns.c @@ -671,6 +671,15 @@ dns_string_to_value (void *cls, uri.target = target; off = 0; + // TODO add more precise uri checking (RFC3986) + if (strstr(target, &":") == NULL || target[0] == 58 || target[strlen(target)-1] == 58) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + _ ("Failed to serialize URI record with target `%s'\n"), + target); + return GNUNET_SYSERR; + } + char uribuf[sizeof(struct GNUNET_TUN_DnsUriRecord) + strlen(target) + 1]; if (GNUNET_OK != -- cgit v1.2.3