im->header.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_INFO);
im->trust = htonl (he->trust);
im->peer = he->identity;
- memcpy (&im[1], he->hello, hs);
+ if (he->hello != NULL)
+ memcpy (&im[1], he->hello, hs);
return im;
}
clen = 0;
cdata = NULL;
left = size;
+ i = 0;
pos = md->items;
- for (i=0;i<md->item_count;i++)
+ while (pos != NULL)
{
comp = GNUNET_NO;
if (0 == (opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS))
if (pos->mime_type != NULL)
left -= strlen (pos->mime_type) + 1;
pos = pos->next;
+ i++;
}
GNUNET_free (ent);