diff options
author | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-03-15 16:51:59 +0000 |
---|---|---|
committer | Martin Schanzenbach <mschanzenbach@posteo.de> | 2012-03-15 16:51:59 +0000 |
commit | 2eec126620f778f8baa7c4976d67e490e409bb30 (patch) | |
tree | 9ba1f9fb1aa5fdaa767797588246ee20a39e3d0c /src | |
parent | 172579d4d2c0af3986943ef1ca907ebe43b7031d (diff) | |
download | gnunet-2eec126620f778f8baa7c4976d67e490e409bb30.tar.gz gnunet-2eec126620f778f8baa7c4976d67e490e409bb30.zip |
-fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/gns/gnunet-service-gns.c | 9 | ||||
-rw-r--r-- | src/gns/gnunet-service-gns_resolver.c | 22 |
2 files changed, 24 insertions, 7 deletions
diff --git a/src/gns/gnunet-service-gns.c b/src/gns/gnunet-service-gns.c index ac5c74818..e843e61ec 100644 --- a/src/gns/gnunet-service-gns.c +++ b/src/gns/gnunet-service-gns.c | |||
@@ -599,6 +599,15 @@ static void handle_get_authority(void *cls, | |||
599 | send_get_auth_response(cah, name); | 599 | send_get_auth_response(cah, name); |
600 | return; | 600 | return; |
601 | } | 601 | } |
602 | |||
603 | if (strcmp(name, GNUNET_GNS_TLD) == 0) | ||
604 | { | ||
605 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
606 | "%s is us. Returning\n", name); | ||
607 | cah->name = NULL; | ||
608 | send_get_auth_response(cah, name); | ||
609 | return; | ||
610 | } | ||
602 | 611 | ||
603 | cah->name = GNUNET_malloc(strlen(name) | 612 | cah->name = GNUNET_malloc(strlen(name) |
604 | - strlen(GNUNET_GNS_TLD) + 1); | 613 | - strlen(GNUNET_GNS_TLD) + 1); |
diff --git a/src/gns/gnunet-service-gns_resolver.c b/src/gns/gnunet-service-gns_resolver.c index a2f61af0e..9b83794f5 100644 --- a/src/gns/gnunet-service-gns_resolver.c +++ b/src/gns/gnunet-service-gns_resolver.c | |||
@@ -1474,13 +1474,21 @@ gns_resolver_get_authority(GNUNET_HashCode zone, | |||
1474 | nah = GNUNET_malloc(sizeof (struct GetNameAuthorityHandle)); | 1474 | nah = GNUNET_malloc(sizeof (struct GetNameAuthorityHandle)); |
1475 | rh = GNUNET_malloc(sizeof (struct ResolverHandle)); | 1475 | rh = GNUNET_malloc(sizeof (struct ResolverHandle)); |
1476 | rh->authority = zone; | 1476 | rh->authority = zone; |
1477 | 1477 | ||
1478 | rh->name = GNUNET_malloc(strlen(name) | 1478 | if (strcmp(GNUNET_GNS_TLD, name) == 0) |
1479 | - strlen(GNUNET_GNS_TLD)); | 1479 | { |
1480 | memset(rh->name, 0, | 1480 | rh->name = GNUNET_malloc(2); |
1481 | strlen(name)-strlen(GNUNET_GNS_TLD)); | 1481 | strcpy(rh->name, ""); |
1482 | memcpy(rh->name, name, | 1482 | } |
1483 | strlen(name)-strlen(GNUNET_GNS_TLD) - 1); | 1483 | else |
1484 | { | ||
1485 | rh->name = GNUNET_malloc(strlen(name) | ||
1486 | - strlen(GNUNET_GNS_TLD)); | ||
1487 | memset(rh->name, 0, | ||
1488 | strlen(name)-strlen(GNUNET_GNS_TLD)); | ||
1489 | memcpy(rh->name, name, | ||
1490 | strlen(name)-strlen(GNUNET_GNS_TLD) - 1); | ||
1491 | } | ||
1484 | 1492 | ||
1485 | nah->name = GNUNET_malloc(strlen(name)+1); | 1493 | nah->name = GNUNET_malloc(strlen(name)+1); |
1486 | memset(nah->name, 0, | 1494 | memset(nah->name, 0, |