- don't crash on NULL tunnels
authorBart Polot <bart@net.in.tum.de>
Wed, 4 Sep 2013 17:01:49 +0000 (17:01 +0000)
committerBart Polot <bart@net.in.tum.de>
Wed, 4 Sep 2013 17:01:49 +0000 (17:01 +0000)
src/mesh/gnunet-service-mesh-enc.c

index b3d91eec2e6a29055836eb5adb0e685c0a3f01fa..39c3385e57049a7d1a3d885f5941d8673cca680c 100644 (file)
@@ -3247,6 +3247,12 @@ tunnel_use_path (struct MeshTunnel2 *t, struct MeshPeerPath *p)
   struct MeshPeer *peer;
   unsigned int own_pos;
 
+  if (NULL == t || NULL == p)
+  {
+    GNUNET_break (0);
+    return NULL;
+  }
+
   GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_NONCE, &cid);
 
   c = connection_new (&cid);