aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-02-11 16:05:03 -0500
committerNick Mathewson <nickm@torproject.org>2013-02-11 16:05:03 -0500
commite3578d52e4d32483422cb867786373c2b7b493b5 (patch)
tree808e252f297b48e331a3dc8c303caddac03298a5 /src/or
parentb840b76b04fa68d2a1ef9a7532837d1b549daa25 (diff)
downloadtor-e3578d52e4d32483422cb867786373c2b7b493b5.tar
tor-e3578d52e4d32483422cb867786373c2b7b493b5.tar.gz
Check whether ei is non-NULL before altering it.
This fixes a crash bug if we fail to generate an extrainfo descriptor. Fixes bug 8208; bugfix on 0.2.3.16-alpha.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/router.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 38f1cdd49..350666da1 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -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,