aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-07-25 22:56:47 +0000
committerNick Mathewson <nickm@torproject.org>2007-07-25 22:56:47 +0000
commit2305c2c7be1d2101d2f666ee88054aa55ab3e348 (patch)
tree899f96bd7ba43c61306de77e9e4a3d6b38cb23c8 /src
parenta66f25935483b1b415a878ed208896886dd1df66 (diff)
downloadtor-2305c2c7be1d2101d2f666ee88054aa55ab3e348.tar
tor-2305c2c7be1d2101d2f666ee88054aa55ab3e348.tar.gz
r13903@catbus: nickm | 2007-07-25 18:03:56 -0400
Make buffer large enough to hold ip6.arpa addresses. This code was not actually used yet, so no user-visible bug existed. (Based on patch by croup.) svn:r10928
Diffstat (limited to 'src')
-rw-r--r--src/or/eventdns.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/eventdns.c b/src/or/eventdns.c
index c2f0c7f4c..2ecdfc0d0 100644
--- a/src/or/eventdns.c
+++ b/src/or/eventdns.c
@@ -2308,7 +2308,8 @@ int evdns_resolve_reverse(struct in_addr *in, int flags, evdns_callback_type cal
}
int evdns_resolve_reverse_ipv6(struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr) {
- char buf[64];
+ /* 32 nybbles, 32 periods, "ip6.arpa", NUL. */
+ char buf[73];
char *cp;
struct request *req;
int i;
@@ -2321,8 +2322,8 @@ int evdns_resolve_reverse_ipv6(struct in6_addr *in, int flags, evdns_callback_ty
*cp++ = "0123456789abcdef"[byte >> 4];
*cp++ = '.';
}
- assert(cp + strlen(".ip6.arpa") < buf+sizeof(buf));
- memcpy(cp, ".ip6.arpa", strlen(".ip6.arpa")+1);
+ assert(cp + strlen("ip6.arpa") < buf+sizeof(buf));
+ memcpy(cp, "ip6.arpa", strlen("ip6.arpa")+1);
log(EVDNS_LOG_DEBUG, "Resolve requested for %s (reverse)", buf);
req = request_new(TYPE_PTR, buf, flags, callback, ptr);
if (!req) return 1;