From: Christian Grothoff Date: Sat, 7 Dec 2013 22:27:13 +0000 (+0000) Subject: -fix #3152 X-Git-Tag: initial-import-from-subversion-38251~5678 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e78d610f4f9bb6f8f04d585309c8e0befda4918e;p=oweals%2Fgnunet.git -fix #3152 --- diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index c7d6a6f40..e15d30ead 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c @@ -705,6 +705,7 @@ get_consensus_slot (uint32_t distance) struct ConsensusSet *cs; unsigned int i; + GNUNET_assert (distance < DEFAULT_FISHEYE_DEPTH - 1); cs = &consensi[distance]; i = 0; while ( (i < cs->array_length) && @@ -731,6 +732,7 @@ allocate_route (struct Route *route, { unsigned int i; + GNUNET_assert (distance < DEFAULT_FISHEYE_DEPTH - 1); i = get_consensus_slot (distance); route->set_offset = i; consensi[distance].targets[i] = route; @@ -1033,6 +1035,8 @@ check_possible_route (void *cls, } return GNUNET_YES; /* got a route to this target already */ } + if (ntohl (target->distance) >= DEFAULT_FISHEYE_DEPTH - 1) + return GNUNET_YES; /* distance is too large to be interesting */ route = GNUNET_new (struct Route); route->next_hop = neighbor; route->target.distance = htonl (ntohl (target->distance) + 1);