- Don't crash on bogus data from client
authorBart Polot <bart@net.in.tum.de>
Tue, 24 Jan 2012 03:03:35 +0000 (03:03 +0000)
committerBart Polot <bart@net.in.tum.de>
Tue, 24 Jan 2012 03:03:35 +0000 (03:03 +0000)
src/mesh/gnunet-service-mesh.c

index b91fb3819087b6f093f6b3c254f085b6a374bbe8..604ad52a980f6f4b9c7f7c62e56469c3c54560bf 100644 (file)
@@ -3884,6 +3884,12 @@ handle_local_tunnel_destroy (void *cls, struct GNUNET_SERVER_Client *client,
   /* Remove from local id hashmap */
   GNUNET_CRYPTO_hash (&tid, sizeof (MESH_TunnelNumber), &hash);
   t = GNUNET_CONTAINER_multihashmap_get (c->own_tunnels, &hash);
+  if (NULL == t)
+  {
+    GNUNET_break (0);
+    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+    return;
+  }
   send_client_tunnel_disconnect(t, c);
   if (c != t->owner)
   {