diff options
author | David Barksdale <amatus@amat.us> | 2017-11-25 23:31:58 -0600 |
---|---|---|
committer | David Barksdale <amatus@amat.us> | 2017-11-25 23:31:58 -0600 |
commit | 2d12edeff095f947c87c8c0a6fe66c125eaf9d8e (patch) | |
tree | 419e05c050929c791384510534f57cc88f6dc2ab | |
parent | 6249fe609735bb4feb6cab00698928c80ba94f68 (diff) | |
download | gnunet-2d12edeff095f947c87c8c0a6fe66c125eaf9d8e.tar.gz gnunet-2d12edeff095f947c87c8c0a6fe66c125eaf9d8e.zip |
Fix array indexing
Found this while investigating #4909, might be related.
-rw-r--r-- | src/cadet/gnunet-service-cadet_paths.c | 4 |
1 files 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, | |||
498 | const struct GNUNET_PeerIdentity *pid; | 498 | const struct GNUNET_PeerIdentity *pid; |
499 | 499 | ||
500 | pid = (off < get_path_length) | 500 | pid = (off < get_path_length) |
501 | ? &get_path[get_path_length - off] | 501 | ? &get_path[get_path_length - off - 1] |
502 | : &put_path[get_path_length + put_path_length - off]; | 502 | : &put_path[get_path_length + put_path_length - off - 1]; |
503 | cpath[off - skip] = GCP_get (pid, | 503 | cpath[off - skip] = GCP_get (pid, |
504 | GNUNET_YES); | 504 | GNUNET_YES); |
505 | /* Check that no peer is twice on the path */ | 505 | /* Check that no peer is twice on the path */ |