[or-cvs] r9262: avoid a crash-all-the-clients segfault if a rogue dir author (tor/trunk/src/or)

arma at seul.org arma at seul.org
Thu Jan 4 06:36:45 UTC 2007


Author: arma
Date: 2007-01-04 01:36:43 -0500 (Thu, 04 Jan 2007)
New Revision: 9262

Modified:
   tor/trunk/src/or/routerparse.c
Log:
avoid a crash-all-the-clients segfault if a rogue dir
authority leaves a "v" line blank.


Modified: tor/trunk/src/or/routerparse.c
===================================================================
--- tor/trunk/src/or/routerparse.c	2007-01-04 05:41:24 UTC (rev 9261)
+++ tor/trunk/src/or/routerparse.c	2007-01-04 06:36:43 UTC (rev 9262)
@@ -1081,7 +1081,7 @@
         rs->is_bad_directory = 1;
     }
   }
-  if ((tok = find_first_by_keyword(tokens, K_V))) {
+  if ((tok = find_first_by_keyword(tokens, K_V)) && tok->n_args) {
     rs->version_known = 1;
     if (strcmpstart(tok->args[0], "Tor ")) {
       rs->version_supports_begindir = 1;



More information about the tor-commits mailing list