From 2d12edeff095f947c87c8c0a6fe66c125eaf9d8e Mon Sep 17 00:00:00 2001 From: David Barksdale Date: Sat, 25 Nov 2017 23:31:58 -0600 Subject: [PATCH] Fix array indexing Found this while investigating #4909, might be related. --- src/cadet/gnunet-service-cadet_paths.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 */ -- 2.25.1