[or-cvs] r14373: Avoid a rare assert that can trigger when Tor doesn't have m (in tor/branches/tor-0_2_0-patches: . src/or)

arma at seul.org arma at seul.org
Tue Apr 15 23:05:45 UTC 2008


Author: arma
Date: 2008-04-15 19:05:44 -0400 (Tue, 15 Apr 2008)
New Revision: 14373

Modified:
   tor/branches/tor-0_2_0-patches/ChangeLog
   tor/branches/tor-0_2_0-patches/src/or/connection.c
Log:
Avoid a rare assert that can trigger when Tor doesn't have much
directory information yet and it tries to fetch a v2 hidden
service descriptor. Fixes bug 651, reported by nwf.


Modified: tor/branches/tor-0_2_0-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_2_0-patches/ChangeLog	2008-04-15 21:11:33 UTC (rev 14372)
+++ tor/branches/tor-0_2_0-patches/ChangeLog	2008-04-15 23:05:44 UTC (rev 14373)
@@ -1,5 +1,8 @@
 Changes in version 0.2.0.24-rc - 2008-04-0?
   o Minor bugfixes:
+    - Avoid a rare assert that can trigger when Tor doesn't have much
+      directory information yet and it tries to fetch a v2 hidden
+      service descriptor. Fixes bug 651, reported by nwf.
     - Initialize log mutex before initializing dmalloc.  Otherwise,
       running with dmalloc would crash. Bugfix on 0.2.0.x-alpha.
     - Do not read the configuration file when we've only been told to

Modified: tor/branches/tor-0_2_0-patches/src/or/connection.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/connection.c	2008-04-15 21:11:33 UTC (rev 14372)
+++ tor/branches/tor-0_2_0-patches/src/or/connection.c	2008-04-15 23:05:44 UTC (rev 14373)
@@ -485,7 +485,9 @@
        * retry as needed. (If a fetch is successful, the connection state
        * is changed to DIR_PURPOSE_HAS_FETCHED_RENDDESC to mark that
        * refetching is unnecessary.) */
-      if (conn->purpose == DIR_PURPOSE_FETCH_RENDDESC_V2)
+      if (conn->purpose == DIR_PURPOSE_FETCH_RENDDESC_V2 &&
+          dir_conn->rend_query &&
+          strlen(dir_conn->rend_query) == REND_SERVICE_ID_LEN_BASE32)
         rend_client_refetch_v2_renddesc(dir_conn->rend_query);
       break;
     case CONN_TYPE_OR:



More information about the tor-commits mailing list