]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Check whether ei is non-NULL before altering it.
authorNick Mathewson <nickm@torproject.org>
Mon, 11 Feb 2013 21:05:03 +0000 (16:05 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 11 Feb 2013 21:05:03 +0000 (16:05 -0500)
This fixes a crash bug if we fail to generate an extrainfo
descriptor.

Fixes bug 8208; bugfix on 0.2.3.16-alpha.

changes/bug8208 [new file with mode: 0644]
src/or/router.c

diff --git a/changes/bug8208 b/changes/bug8208
new file mode 100644 (file)
index 0000000..c85db90
--- /dev/null
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Avoid a crash if we fail to generate an extrinfo descriptor.
+      Fixes bug 8208; bugfix on 0.2.3.16-alpha. Found by Coverity;
+      this is CID 718634.
index 38f1cdd49565baaa0275f279162d4f9b28b7d040..350666da1a4ed3d26244199ee5cfdf298b8ed128 100644 (file)
@@ -1702,9 +1702,13 @@ router_rebuild_descriptor(int force)
        anyway, since they don't have a DirPort, and always connect to the
        bridge authority anonymously.  But just in case they somehow think of
        sending them on an unencrypted connection, don't allow them to try. */
-    ri->cache_info.send_unencrypted = ei->cache_info.send_unencrypted = 0;
+    ri->cache_info.send_unencrypted = 0;
+    if (ei)
+      ei->cache_info.send_unencrypted = 0
   } else {
-    ri->cache_info.send_unencrypted = ei->cache_info.send_unencrypted = 1;
+    ri->cache_info.send_unencrypted = 1;
+    if (ei)
+      ei->cache_info.send_unencrypted = 1;
   }
 
   router_get_router_hash(ri->cache_info.signed_descriptor_body,