[or-cvs] r8447: Fix bug in r8440: base32 uses 5 bytes per char, not 4. (tor/trunk/src/or)

nickm at seul.org nickm at seul.org
Thu Sep 21 22:24:52 UTC 2006


Author: nickm
Date: 2006-09-21 18:24:45 -0400 (Thu, 21 Sep 2006)
New Revision: 8447

Modified:
   tor/trunk/src/or/dns.c
Log:
Fix bug in r8440: base32 uses 5 bytes per char, not 4.

Modified: tor/trunk/src/or/dns.c
===================================================================
--- tor/trunk/src/or/dns.c	2006-09-21 21:49:36 UTC (rev 8446)
+++ tor/trunk/src/or/dns.c	2006-09-21 22:24:45 UTC (rev 8447)
@@ -1606,7 +1606,7 @@
 launch_wildcard_check(int len, const char *suffix)
 {
   char random_bytes[16], name[64], *addr;
-  size_t n = (len+1)/2;
+  size_t n = (len*5+7)/8;
   int r;
 
   tor_assert(n <= sizeof(random_bytes));



More information about the tor-commits mailing list