summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-06-12 12:12:11 -0400
committerNick Mathewson <nickm@torproject.org>2013-06-12 12:12:11 -0400
commite602c4031b57f0780661ce0473a5e30d187d385c (patch)
tree95b222a72c289ce457faf152e3392c3329ad2190 /src/or/control.c
parentf455686b77e4ac686251c6edf1f4a506a369866c (diff)
downloadtor-e602c4031b57f0780661ce0473a5e30d187d385c.tar.gz
tor-e602c4031b57f0780661ce0473a5e30d187d385c.zip
Make all consumers of microdesc_t.body tolerate NULL
This is another fix to try to mitigate recurrences of 8031/8822.
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 48782682c7..5ae7b71b5d 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1711,8 +1711,7 @@ getinfo_helper_dir(control_connection_t *control_conn,
const node_t *node = node_get_by_hex_id(question+strlen("md/id/"));
const microdesc_t *md = NULL;
if (node) md = node->md;
- if (md) {
- tor_assert(md->body);
+ if (md && md->body) {
*answer = tor_strndup(md->body, md->bodylen);
}
} else if (!strcmpstart(question, "md/name/")) {
@@ -1722,8 +1721,7 @@ getinfo_helper_dir(control_connection_t *control_conn,
/* XXXX duplicated code */
const microdesc_t *md = NULL;
if (node) md = node->md;
- if (md) {
- tor_assert(md->body);
+ if (md && md->body) {
*answer = tor_strndup(md->body, md->bodylen);
}
} else if (!strcmpstart(question, "desc-annotations/id/")) {