From: Christian Grothoff Date: Tue, 31 Jan 2017 13:16:20 +0000 (+0100) Subject: Fix off-by-one X-Git-Tag: taler-0.2.1~221 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=f86056c4d1e26c8ba6c4a5243654e7b8516cb378;p=oweals%2Fgnunet.git Fix off-by-one --- diff --git a/src/cadet/gnunet-service-cadet-new_peer.c b/src/cadet/gnunet-service-cadet-new_peer.c index 8db375510..d9a87600b 100644 --- a/src/cadet/gnunet-service-cadet-new_peer.c +++ b/src/cadet/gnunet-service-cadet-new_peer.c @@ -1146,7 +1146,7 @@ GCP_iterate_paths (struct CadetPeer *cp, if (GNUNET_NO == callback (callback_cls, path, - 1)) + 0)) return ret; } for (unsigned int i=0;ipath_dll_length;i++) diff --git a/src/cadet/gnunet-service-cadet-new_tunnels.c b/src/cadet/gnunet-service-cadet-new_tunnels.c index ee1502cab..cbc1303d9 100644 --- a/src/cadet/gnunet-service-cadet-new_tunnels.c +++ b/src/cadet/gnunet-service-cadet-new_tunnels.c @@ -2416,6 +2416,7 @@ consider_path_cb (void *cls, struct EvaluationSummary es; struct CadetTConnection *ct; + GNUNET_assert (off < GCPP_get_length (path)); es.min_length = UINT_MAX; es.max_length = 0; es.max_desire = 0;