[or-cvs] r12549: Don't crash if we get an unexpected value for the PublishSer (in tor/trunk: . src/or)

arma at seul.org arma at seul.org
Thu Nov 22 00:43:23 UTC 2007


Author: arma
Date: 2007-11-21 19:43:22 -0500 (Wed, 21 Nov 2007)
New Revision: 12549

Modified:
   tor/trunk/ChangeLog
   tor/trunk/src/or/config.c
Log:
Don't crash if we get an unexpected value for the
PublishServerDescriptor config option. Reported by Matt Edman;
bugfix on 0.2.0.9-alpha.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-11-21 16:54:24 UTC (rev 12548)
+++ tor/trunk/ChangeLog	2007-11-22 00:43:22 UTC (rev 12549)
@@ -3,6 +3,9 @@
     - The fix in 0.2.0.12-alpha cleared the "hsdir" flag in v3 network
       consensus documents when there are too many relays at a single
       IP address. Now clear it in v2 network status documents too.
+    - Don't crash if we get an unexpected value for the
+      PublishServerDescriptor config option. Reported by Matt Edman;
+      bugfix on 0.2.0.9-alpha.
 
 
 Changes in version 0.2.0.12-alpha - 2007-11-16

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2007-11-21 16:54:24 UTC (rev 12548)
+++ tor/trunk/src/or/config.c	2007-11-22 00:43:22 UTC (rev 12549)
@@ -2821,11 +2821,10 @@
       });
   }
 
-  if ((i = parse_authority_type_from_list(options->PublishServerDescriptor,
+  if ((parse_authority_type_from_list(options->PublishServerDescriptor,
                                &options->_PublishServerDescriptor, 1) < 0)) {
     r = tor_snprintf(buf, sizeof(buf),
-        "Unrecognized value '%s' for PublishServerDescriptor",
-                  (char*)smartlist_get(options->PublishServerDescriptor, -i));
+        "Unrecognized value for PublishServerDescriptor");
     *msg = tor_strdup(r >= 0 ? buf : "internal error");
     return -1;
   }



More information about the tor-commits mailing list