From 65f2eec694f18a64291cc85317b9f22dacc1d8e4 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 1 Feb 2018 16:33:52 -0500 Subject: Correctly handle NULL returns from parse_protocol_list when voting. In some cases we had checked for it, but in others we had not. One of these cases could have been used to remotely cause denial-of-service against directory authorities while they attempted to vote. Fixes TROVE-2018-001. --- src/or/protover.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/or') diff --git a/src/or/protover.c b/src/or/protover.c index 98957cabdf..a750774623 100644 --- a/src/or/protover.c +++ b/src/or/protover.c @@ -554,6 +554,12 @@ protover_compute_vote(const smartlist_t *list_of_proto_strings, // First, parse the inputs and break them into singleton entries. SMARTLIST_FOREACH_BEGIN(list_of_proto_strings, const char *, vote) { smartlist_t *unexpanded = parse_protocol_list(vote); + if (! unexpanded) { + log_warn(LD_NET, "I failed with parsing a protocol list from " + "an authority. The offending string was: %s", + escaped(vote)); + continue; + } smartlist_t *this_vote = expand_protocol_list(unexpanded); if (this_vote == NULL) { log_warn(LD_NET, "When expanding a protocol list from an authority, I " -- cgit v1.2.3-54-g00ecf