aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/peerinfo/gnunet-service-peerinfo.c3
-rw-r--r--src/util/container_meta_data.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c
index e200eae2f..14c914beb 100644
--- a/src/peerinfo/gnunet-service-peerinfo.c
+++ b/src/peerinfo/gnunet-service-peerinfo.c
@@ -131,7 +131,8 @@ make_info_message (const struct HostEntry *he)
131 im->header.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_INFO); 131 im->header.type = htons (GNUNET_MESSAGE_TYPE_PEERINFO_INFO);
132 im->trust = htonl (he->trust); 132 im->trust = htonl (he->trust);
133 im->peer = he->identity; 133 im->peer = he->identity;
134 memcpy (&im[1], he->hello, hs); 134 if (he->hello != NULL)
135 memcpy (&im[1], he->hello, hs);
135 return im; 136 return im;
136} 137}
137 138
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c
index fadb0dede..89a63d659 100644
--- a/src/util/container_meta_data.c
+++ b/src/util/container_meta_data.c
@@ -869,8 +869,9 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData
869 clen = 0; 869 clen = 0;
870 cdata = NULL; 870 cdata = NULL;
871 left = size; 871 left = size;
872 i = 0;
872 pos = md->items; 873 pos = md->items;
873 for (i=0;i<md->item_count;i++) 874 while (pos != NULL)
874 { 875 {
875 comp = GNUNET_NO; 876 comp = GNUNET_NO;
876 if (0 == (opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS)) 877 if (0 == (opt & GNUNET_CONTAINER_META_DATA_SERIALIZE_NO_COMPRESS))
@@ -967,6 +968,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData
967 if (pos->mime_type != NULL) 968 if (pos->mime_type != NULL)
968 left -= strlen (pos->mime_type) + 1; 969 left -= strlen (pos->mime_type) + 1;
969 pos = pos->next; 970 pos = pos->next;
971 i++;
970 } 972 }
971 GNUNET_free (ent); 973 GNUNET_free (ent);
972 974