[or-cvs] fix seg faults when router_load_single_router fails

Roger Dingledine arma at seul.org
Wed May 18 03:42:48 UTC 2005


Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	routerlist.c 
Log Message:
fix seg faults when router_load_single_router fails


Index: routerlist.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.233
retrieving revision 1.234
diff -u -d -r1.233 -r1.234
--- routerlist.c	17 May 2005 17:01:36 -0000	1.233
+++ routerlist.c	18 May 2005 03:42:46 -0000	1.234
@@ -916,13 +916,13 @@
   }
   if (router_is_me(ri)) {
     log_fn(LOG_WARN, "Router's identity key matches mine; dropping.");
-    if (msg && !*msg) *msg = "Router's identity key matches mine.";
+    if (msg) *msg = "Router's identity key matches mine.";
     routerinfo_free(ri);
     return 0;
   }
   if (router_resolve(ri)<0) {
     log_fn(LOG_WARN, "Couldn't resolve router address; dropping.");
-    if (msg && !*msg) *msg = "Couldn't resolve router address.";
+    if (msg) *msg = "Couldn't resolve router address.";
     routerinfo_free(ri);
     return 0;
   }
@@ -934,7 +934,7 @@
   }
   if (router_add_to_routerlist(ri, msg)<0) {
     log_fn(LOG_WARN, "Couldn't add router to list; dropping.");
-    if (msg && !*msg) *msg = "Couldn't add router to list.";
+    if (msg) *msg = "Couldn't add router to list.";
     /* ri is already freed */
     return 0;
   } else {



More information about the tor-commits mailing list