[or-cvs] r9990: When advancing a string pointer, make sure we do not later f (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Thu Apr 19 15:23:41 UTC 2007


Author: nickm
Date: 2007-04-19 11:23:38 -0400 (Thu, 19 Apr 2007)
New Revision: 9990

Modified:
   tor/trunk/
   tor/trunk/src/or/directory.c
Log:
 r12434 at catbus:  nickm | 2007-04-19 11:23:35 -0400
 When advancing a string pointer, make sure we do not later free the altered pointer.  Fixes bug 416, introduced in r9971.



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

Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2007-04-19 06:14:20 UTC (rev 9989)
+++ tor/trunk/src/or/directory.c	2007-04-19 15:23:38 UTC (rev 9990)
@@ -1685,6 +1685,7 @@
 
   if (!strcmpstart(url,"/tor/server/") ||
       !strcmpstart(url,"/tor/extra/")) {
+    char *url_mem = url;
     size_t url_len = strlen(url);
     int deflated = !strcmp(url+url_len-2, ".z");
     int res;
@@ -1724,7 +1725,7 @@
     else
       conn->dir_spool_src =
         is_extra ? DIR_SPOOL_EXTRA_BY_FP : DIR_SPOOL_SERVER_BY_FP;
-    tor_free(url);
+    tor_free(url_mem);
     if (res < 0)
       write_http_status_line(conn, 404, msg);
     else {



More information about the tor-commits mailing list