- coverity
authorMatthias Wachs <wachs@net.in.tum.de>
Wed, 20 Jun 2012 11:07:24 +0000 (11:07 +0000)
committerMatthias Wachs <wachs@net.in.tum.de>
Wed, 20 Jun 2012 11:07:24 +0000 (11:07 +0000)
src/ats/ats_api_scheduling.c

index 398c8b2d0f5570f4598b490859eb6d32eb592608..88a6423b44f45eb433bdc70b055b592b374439f1 100644 (file)
@@ -1134,7 +1134,8 @@ GNUNET_ATS_address_add (struct GNUNET_ATS_SchedulingHandle *sh,
   memcpy (am, ats, ats_count * sizeof (struct GNUNET_ATS_Information));
   pm = (char *) &am[ats_count];
   memcpy (pm, address->address, address->address_length);
-  memcpy (&pm[address->address_length], address->transport_name, namelen);
+  if (NULL != address->transport_name)
+       memcpy (&pm[address->address_length], address->transport_name, namelen);
   GNUNET_CONTAINER_DLL_insert_tail (sh->pending_head, sh->pending_tail, p);
   do_transmit (sh);
   return GNUNET_OK;