[or-cvs] r9265: when we added orport= to the dirserver line, we started free (tor/trunk/src/or)

arma at seul.org arma at seul.org
Fri Jan 5 01:23:35 UTC 2007


Author: arma
Date: 2007-01-04 20:23:34 -0500 (Thu, 04 Jan 2007)
New Revision: 9265

Modified:
   tor/trunk/src/or/config.c
Log:
when we added orport= to the dirserver line, we started
freeing the string in the middle. this was probably xiando's
crash bug.


Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2007-01-05 01:12:10 UTC (rev 9264)
+++ tor/trunk/src/or/config.c	2007-01-05 01:23:34 UTC (rev 9265)
@@ -3365,10 +3365,11 @@
       is_v2_authority = 0;
     } else if (!strcasecmpstart(flag, "orport=")) {
       int ok;
-      flag += strlen("orport=");
-      or_port = (uint16_t) tor_parse_long(flag, 10, 1, 65535, &ok, NULL);
+      char *portstring = flag + strlen("orport=");
+      or_port = (uint16_t) tor_parse_long(portstring, 10, 1, 65535, &ok, NULL);
       if (!ok)
-        log_warn(LD_CONFIG, "Invalid orport '%s' on DirServer line.", flag);
+        log_warn(LD_CONFIG, "Invalid orport '%s' on DirServer line.",
+                 portstring);
     } else {
       log_warn(LD_CONFIG, "Unrecognized flag '%s' on DirServer line",
                flag);



More information about the tor-commits mailing list