Fix off-by-one
authorChristian Grothoff <christian@grothoff.org>
Tue, 31 Jan 2017 13:16:20 +0000 (14:16 +0100)
committerChristian Grothoff <christian@grothoff.org>
Tue, 31 Jan 2017 13:16:20 +0000 (14:16 +0100)
src/cadet/gnunet-service-cadet-new_peer.c
src/cadet/gnunet-service-cadet-new_tunnels.c

index 8db375510d93884401a7373f3405579267cca164..d9a87600bf6e5cd7864c268463c1a699379527f6 100644 (file)
@@ -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;i<cp->path_dll_length;i++)
index ee1502cabe5d9808e24f0f76b94368fccd747b1b..cbc1303d9e4072c4c89c32eb9f58f539fee354bf 100644 (file)
@@ -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;