From: David Barksdale Date: Sun, 26 Nov 2017 05:31:58 +0000 (-0600) Subject: Fix array indexing X-Git-Tag: gnunet-0.11.0rc0~98^2^2~1 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2d12edeff095f947c87c8c0a6fe66c125eaf9d8e;p=oweals%2Fgnunet.git Fix array indexing Found this while investigating #4909, might be related. --- diff --git a/src/cadet/gnunet-service-cadet_paths.c b/src/cadet/gnunet-service-cadet_paths.c index e75fd393c..79eed0dcc 100644 --- a/src/cadet/gnunet-service-cadet_paths.c +++ b/src/cadet/gnunet-service-cadet_paths.c @@ -498,8 +498,8 @@ GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path, const struct GNUNET_PeerIdentity *pid; pid = (off < get_path_length) - ? &get_path[get_path_length - off] - : &put_path[get_path_length + put_path_length - off]; + ? &get_path[get_path_length - off - 1] + : &put_path[get_path_length + put_path_length - off - 1]; cpath[off - skip] = GCP_get (pid, GNUNET_YES); /* Check that no peer is twice on the path */