[or-cvs] Remove string size limit on NEWDESC messages; solve bug 291.

Nick Mathewson nickm at seul.org
Mon May 22 23:24:08 UTC 2006


Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv5373/src/or

Modified Files:
	control.c 
Log Message:
Remove string size limit on NEWDESC messages; solve bug 291.

Index: control.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/control.c,v
retrieving revision 1.190
retrieving revision 1.191
diff -u -p -d -r1.190 -r1.191
--- control.c	18 Apr 2006 03:07:24 -0000	1.190
+++ control.c	22 May 2006 23:24:06 -0000	1.191
@@ -2852,8 +2852,12 @@ control_event_descriptors_changed(smartl
     tor_free(msg);
   }
   if (EVENT_IS_INTERESTING1(EVENT_NEW_DESC)) {
-    msg = smartlist_join_strings(identities, " ", 0, &len);
-    send_control1_event(EVENT_NEW_DESC, "650 NEWDESC %s\r\n", msg);
+    char *ids = smartlist_join_strings(identities, " ", 0, &len);
+    size_t len = strlen(ids)+32;
+    msg = tor_malloc(len);
+    tor_snprintf(msg, len, "650 NEWDESC %s\r\n", ids);
+    send_control1_event_string(EVENT_NEW_DESC, msg);
+    tor_free(ids);
     tor_free(msg);
   }
   SMARTLIST_FOREACH(identities, char *, cp, tor_free(cp));



More information about the tor-commits mailing list