aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Nadler <sebastian.nadler@tum.de>2023-11-19 17:06:55 +0100
committerSebastian Nadler <sebastian.nadler@tum.de>2023-11-30 19:33:50 +0100
commit8b0cafb1d8545fc06c5670f42b759b00d5c059b5 (patch)
treeb564d3a367ca80b3b9a60926425fb810d31983e6
parent86e8344d62ca7daf3239dfe1284ecf72f342e921 (diff)
downloadgnunet-8b0cafb1d8545fc06c5670f42b759b00d5c059b5.tar.gz
gnunet-8b0cafb1d8545fc06c5670f42b759b00d5c059b5.zip
Fix URI record serialization issue
-rw-r--r--src/plugin/gnsrecord/plugin_gnsrecord_dns.c9
1 files changed, 9 insertions, 0 deletions
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,
671 uri.target = target; 671 uri.target = target;
672 off = 0; 672 off = 0;
673 673
674 // TODO add more precise uri checking (RFC3986)
675 if (strstr(target, &":") == NULL || target[0] == 58 || target[strlen(target)-1] == 58)
676 {
677 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
678 _ ("Failed to serialize URI record with target `%s'\n"),
679 target);
680 return GNUNET_SYSERR;
681 }
682
674 char uribuf[sizeof(struct GNUNET_TUN_DnsUriRecord) + strlen(target) + 1]; 683 char uribuf[sizeof(struct GNUNET_TUN_DnsUriRecord) + strlen(target) + 1];
675 684
676 if (GNUNET_OK != 685 if (GNUNET_OK !=