aboutsummaryrefslogtreecommitdiff
path: root/src/gns/gnunet-service-gns_resolver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gns/gnunet-service-gns_resolver.c')
-rw-r--r--src/gns/gnunet-service-gns_resolver.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c
index 49c1b340a..2f8a55804 100644
--- a/src/gns/gnunet-service-gns_resolver.c
+++ b/src/gns/gnunet-service-gns_resolver.c
@@ -764,6 +764,7 @@ transmit_lookup_dns_result (struct GNS_ResolverHandle *rh)
764 rd[i].data = pos->data; 764 rd[i].data = pos->data;
765 rd[i].data_size = pos->data_size; 765 rd[i].data_size = pos->data_size;
766 rd[i].record_type = pos->record_type; 766 rd[i].record_type = pos->record_type;
767 rd[i].flags = GNUNET_GNSRECORD_RF_NONE;
767 /** 768 /**
768 * If this is a LEHO, we added this before. It must be a supplemental 769 * If this is a LEHO, we added this before. It must be a supplemental
769 * record #LSD0001 770 * record #LSD0001
@@ -772,12 +773,11 @@ transmit_lookup_dns_result (struct GNS_ResolverHandle *rh)
772 rd[i].flags |= GNUNET_GNSRECORD_RF_SUPPLEMENTAL; 773 rd[i].flags |= GNUNET_GNSRECORD_RF_SUPPLEMENTAL;
773 if (0 == pos->expiration_time) 774 if (0 == pos->expiration_time)
774 { 775 {
775 rd[i].flags = GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION; 776 rd[i].flags |= GNUNET_GNSRECORD_RF_RELATIVE_EXPIRATION;
776 rd[i].expiration_time = 0; 777 rd[i].expiration_time = 0;
777 } 778 }
778 else 779 else
779 { 780 {
780 rd[i].flags = GNUNET_GNSRECORD_RF_NONE;
781 rd[i].expiration_time = pos->expiration_time; 781 rd[i].expiration_time = pos->expiration_time;
782 } 782 }
783 i++; 783 i++;
@@ -1764,6 +1764,8 @@ recursive_gns2dns_resolution (struct GNS_ResolverHandle *rh,
1764 /** 1764 /**
1765 * Records other than GNS2DNS not allowed 1765 * Records other than GNS2DNS not allowed
1766 */ 1766 */
1767 if (NULL != ns)
1768 GNUNET_free (ns);
1767 return GNUNET_SYSERR; 1769 return GNUNET_SYSERR;
1768 } 1770 }
1769 off = 0; 1771 off = 0;
@@ -1771,15 +1773,22 @@ recursive_gns2dns_resolution (struct GNS_ResolverHandle *rh,
1771 rd[i].data_size, 1773 rd[i].data_size,
1772 &off); 1774 &off);
1773 ip = GNUNET_strdup (&((const char *) rd[i].data)[off]); 1775 ip = GNUNET_strdup (&((const char *) rd[i].data)[off]);
1776 if ((NULL == n) ||
1777 (NULL == ip))
1778 {
1779 GNUNET_break_op (0);
1780 if (NULL != n)
1781 GNUNET_free (n);
1782 if (NULL != ip)
1783 GNUNET_free (ip);
1784 continue;
1785 }
1786
1774 off += strlen (ip) + 1; 1787 off += strlen (ip) + 1;
1775 1788
1776 if ((NULL == n) || 1789 if (off != rd[i].data_size)
1777 (NULL == ip) ||
1778 (off != rd[i].data_size))
1779 { 1790 {
1780 GNUNET_break_op (0); 1791 GNUNET_break_op (0);
1781 GNUNET_free (n);
1782 GNUNET_free (ip);
1783 continue; 1792 continue;
1784 } 1793 }
1785 /* resolve 'ip' to determine the IP(s) of the DNS 1794 /* resolve 'ip' to determine the IP(s) of the DNS
@@ -1909,6 +1918,8 @@ recursive_gns2dns_resolution (struct GNS_ResolverHandle *rh,
1909 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1918 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1910 _ ("Name `%s' cannot be converted to IDNA."), 1919 _ ("Name `%s' cannot be converted to IDNA."),
1911 tmp); 1920 tmp);
1921 GNUNET_free (tmp);
1922 GNUNET_free (ac);
1912 return GNUNET_SYSERR; 1923 return GNUNET_SYSERR;
1913 } 1924 }
1914 GNUNET_free (tmp); 1925 GNUNET_free (tmp);
@@ -1922,6 +1933,8 @@ recursive_gns2dns_resolution (struct GNS_ResolverHandle *rh,
1922 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, 1933 GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
1923 _ ("GNS lookup resulted in DNS name that is too long (`%s')\n"), 1934 _ ("GNS lookup resulted in DNS name that is too long (`%s')\n"),
1924 ac->label); 1935 ac->label);
1936 GNUNET_free (ac->label);
1937 GNUNET_free (ac);
1925 return GNUNET_SYSERR; 1938 return GNUNET_SYSERR;
1926 } 1939 }
1927 continue_with_gns2dns (ac); 1940 continue_with_gns2dns (ac);