[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r10376: Segfault less. Somebody needs to look over why exactly this (tor/trunk/src/or)



Author: weasel
Date: 2007-05-28 17:34:42 -0400 (Mon, 28 May 2007)
New Revision: 10376

Modified:
   tor/trunk/src/or/directory.c
   tor/trunk/src/or/dirserv.c
Log:
Segfault less.  Somebody needs to look over why exactly this helps.  re #436

Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2007-05-28 20:44:51 UTC (rev 10375)
+++ tor/trunk/src/or/directory.c	2007-05-28 21:34:42 UTC (rev 10376)
@@ -1960,7 +1960,7 @@
 
   if (authdir_mode_handles_descs(options) &&
       !strcmp(url,"/tor/")) { /* server descriptor post */
-    const char *msg;
+    const char *msg = NULL;
     int r = dirserv_add_multiple_descriptors(body, &msg);
     tor_assert(msg);
     if (r > 0)

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2007-05-28 20:44:51 UTC (rev 10375)
+++ tor/trunk/src/or/dirserv.c	2007-05-28 21:34:42 UTC (rev 10376)
@@ -528,6 +528,7 @@
   list = smartlist_create();
   if (!router_parse_list_from_string(&s, NULL, list, SAVED_NOWHERE, 0)) {
     SMARTLIST_FOREACH(list, routerinfo_t *, ri, {
+        msg_out = NULL;
         r_tmp = dirserv_add_descriptor(ri, &msg_out);
         if (r_tmp < r) {
           r = r_tmp;
@@ -541,6 +542,7 @@
   s = desc;
   if (!router_parse_list_from_string(&s, NULL, list, SAVED_NOWHERE, 1)) {
     SMARTLIST_FOREACH(list, extrainfo_t *, ei, {
+        msg_out = NULL;
         r_tmp = dirserv_add_extrainfo(ei, &msg_out);
         if (r_tmp < r) {
           r = r_tmp;