[or-cvs] r17670: {tor} Backport: Avoid nop call to control_event_or_authdir_new_des (tor/branches/tor-0_2_0-patches/src/or)

nickm at seul.org nickm at seul.org
Thu Dec 18 04:47:26 UTC 2008


Author: nickm
Date: 2008-12-17 23:47:24 -0500 (Wed, 17 Dec 2008)
New Revision: 17670

Modified:
   tor/branches/tor-0_2_0-patches/src/or/dirserv.c
Log:
Backport: Avoid nop call to control_event_or_authdir_new_descriptor that makes coverity think we are dereferencing a null pointer.  It is safe, I think, but entirely too clever for our own good.

Modified: tor/branches/tor-0_2_0-patches/src/or/dirserv.c
===================================================================
--- tor/branches/tor-0_2_0-patches/src/or/dirserv.c	2008-12-18 04:45:51 UTC (rev 17669)
+++ tor/branches/tor-0_2_0-patches/src/or/dirserv.c	2008-12-18 04:47:24 UTC (rev 17670)
@@ -702,7 +702,8 @@
     return r == -1 ? 0 : -1;
   } else {
     smartlist_t *changed;
-    control_event_or_authdir_new_descriptor("ACCEPTED", desc, desclen, *msg);
+    if (desc)
+      control_event_or_authdir_new_descriptor("ACCEPTED", desc, desclen, *msg);
 
     changed = smartlist_create();
     smartlist_add(changed, ri);



More information about the tor-commits mailing list