[or-cvs] r10928: Make buffer large enough to hold ip6.arpa addresses. This co (in tor/trunk: . src/or)
nickm at seul.org
nickm at seul.org
Wed Jul 25 22:56:47 UTC 2007
Author: nickm
Date: 2007-07-25 18:56:47 -0400 (Wed, 25 Jul 2007)
New Revision: 10928
Modified:
tor/trunk/
tor/trunk/src/or/eventdns.c
Log:
r13903 at 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.)
Property changes on: tor/trunk
___________________________________________________________________
svk:merge ticket from /tor/trunk [r13903] on 8246c3cf-6607-4228-993b-4d95d33730f1
Modified: tor/trunk/src/or/eventdns.c
===================================================================
--- tor/trunk/src/or/eventdns.c 2007-07-25 22:56:44 UTC (rev 10927)
+++ tor/trunk/src/or/eventdns.c 2007-07-25 22:56:47 UTC (rev 10928)
@@ -2308,7 +2308,8 @@
}
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 @@
*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;
More information about the tor-commits
mailing list