fix segfault
authorMatthias Wachs <wachs@net.in.tum.de>
Fri, 10 Jun 2011 15:38:43 +0000 (15:38 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Fri, 10 Jun 2011 15:38:43 +0000 (15:38 +0000)
src/transport/plugin_transport_tcp.c

index 689cb37842c714fcc8dc3be868df6f713fa0fe0f..4ded5aadd1b3f2ce974a64672790dc22551da1d0 100644 (file)
@@ -1813,15 +1813,18 @@ handle_tcp_nat_probe (void *cls,
       GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
       return;
     }
+
+  tcp_nat_probe = (const struct TCP_NAT_ProbeMessage *)message;
+
   if (0 == memcmp (&tcp_nat_probe->clientIdentity,
-                  plugin->env->my_identity,
-                  sizeof (struct GNUNET_PeerIdentity)))
+                   plugin->env->my_identity,
+                   sizeof (struct GNUNET_PeerIdentity)))
     {
       /* refuse connections from ourselves */
       GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
       return;
     }
-  tcp_nat_probe = (const struct TCP_NAT_ProbeMessage *)message;
+
   session = GNUNET_CONTAINER_multihashmap_get(plugin->nat_wait_conns, 
                                              &tcp_nat_probe->clientIdentity.hashPubKey);
   if (session == NULL)