important check
authorMatthias Wachs <wachs@net.in.tum.de>
Fri, 12 Jul 2013 14:15:37 +0000 (14:15 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Fri, 12 Jul 2013 14:15:37 +0000 (14:15 +0000)
src/transport/plugin_transport_udp.c

index 9c8c585debf88111318cc0dfc4453bcbcba57b5c..925159a76cc9b777dbdd5bc225b4dd0b5526f63c 100644 (file)
@@ -1562,6 +1562,15 @@ udp_plugin_get_session (void *cls,
 {
   struct Session * s = NULL;
 
+  if (NULL == address)
+  {
+       GNUNET_break (0);
+       return NULL;
+  }
+  if ((address->address_length != sizeof (struct IPv4UdpAddress)) &&
+               (address->address_length != sizeof (struct IPv6UdpAddress)))
+               return NULL;
+
   /* otherwise create new */
   if (NULL != (s = udp_plugin_lookup_session(cls, address)))
        return s;