do not test against unset cpath values that we skipped
authorChristian Grothoff <christian@grothoff.org>
Tue, 31 Jan 2017 10:28:33 +0000 (11:28 +0100)
committerChristian Grothoff <christian@grothoff.org>
Tue, 31 Jan 2017 10:28:33 +0000 (11:28 +0100)
src/cadet/gnunet-service-cadet-new_paths.c

index 5bb658797a2177d7e35c695f535ff0e109b29252..4f2c0036fea17e2be19957b5403dba59a070bcd9 100644 (file)
@@ -489,7 +489,7 @@ GCPP_try_path_from_dht (const struct GNUNET_PeerIdentity *get_path,
     cpath[off - skip] = GCP_get (pid,
                                  GNUNET_YES);
     /* Check that no peer is twice on the path */
-    for (unsigned int i=0;i<off;i++)
+    for (unsigned int i=0;i<off - skip;i++)
     {
       if (cpath[i] == cpath[off])
       {