[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r10788: Fix an assert error in 455 patch. (in tor/trunk: . src/or)



Author: nickm
Date: 2007-07-10 18:44:32 -0400 (Tue, 10 Jul 2007)
New Revision: 10788

Modified:
   tor/trunk/
   tor/trunk/src/or/routerparse.c
Log:
 r13691@catbus:  nickm | 2007-07-10 18:44:30 -0400
 Fix an assert error in 455 patch.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r13691] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/routerparse.c
===================================================================
--- tor/trunk/src/or/routerparse.c	2007-07-10 21:46:33 UTC (rev 10787)
+++ tor/trunk/src/or/routerparse.c	2007-07-10 22:44:32 UTC (rev 10788)
@@ -2097,7 +2097,6 @@
 
   /* *s might not end with \n, so we need to extend it with one. */
   len = strlen(s);
-  eos = s + len;
   cp = tmp = tor_malloc(len+2);
   for (idx = 0; idx < len; ++idx) {
     tmp[idx] = TOR_TOLOWER(s[idx]);
@@ -2113,6 +2112,7 @@
     tor_free(tmp);
     cp = tmp = new_str;
   }
+  eos = cp + strlen(cp);
   tok = get_next_token(&cp, eos, routerdesc_token_table);
   if (tok->tp == _ERR) {
     log_warn(LD_DIR, "Error reading address policy: %s", tok->error);