aboutsummaryrefslogtreecommitdiff
path: root/src/psycstore/test_plugin_psycstore.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-07-08 17:20:23 +0000
committerChristian Grothoff <christian@grothoff.org>2016-07-08 17:20:23 +0000
commitd8c53b12a818ff7cf82d06a1a69c395bdef85ee6 (patch)
tree0ebb0db416c157fcfde51a941185819dd12d51fd /src/psycstore/test_plugin_psycstore.c
parent5184c17d32a39c928c2a0fec3ee1ad098bbaa562 (diff)
downloadgnunet-d8c53b12a818ff7cf82d06a1a69c395bdef85ee6.tar.gz
gnunet-d8c53b12a818ff7cf82d06a1a69c395bdef85ee6.zip
-avoid calling memcpy() with NULL argument, even if len is 0
Diffstat (limited to 'src/psycstore/test_plugin_psycstore.c')
-rw-r--r--src/psycstore/test_plugin_psycstore.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/psycstore/test_plugin_psycstore.c b/src/psycstore/test_plugin_psycstore.c
index fc5e1f6b6..0959da642 100644
--- a/src/psycstore/test_plugin_psycstore.c
+++ b/src/psycstore/test_plugin_psycstore.c
@@ -218,7 +218,7 @@ run (void *cls, char *const *args, const char *cfgfile,
218 msg->fragment_offset = GNUNET_htonll (0); 218 msg->fragment_offset = GNUNET_htonll (0);
219 msg->flags = htonl (GNUNET_MULTICAST_MESSAGE_LAST_FRAGMENT); 219 msg->flags = htonl (GNUNET_MULTICAST_MESSAGE_LAST_FRAGMENT);
220 220
221 memcpy (&msg[1], &channel_pub_key, sizeof (channel_pub_key)); 221 GNUNET_memcpy (&msg[1], &channel_pub_key, sizeof (channel_pub_key));
222 222
223 msg->purpose.size = htonl (ntohs (msg->header.size) 223 msg->purpose.size = htonl (ntohs (msg->header.size)
224 - sizeof (msg->header) 224 - sizeof (msg->header)
@@ -272,7 +272,7 @@ run (void *cls, char *const *args, const char *cfgfile,
272 struct GNUNET_MULTICAST_MessageHeader *msg1 272 struct GNUNET_MULTICAST_MessageHeader *msg1
273 = GNUNET_malloc (sizeof (*msg1) + sizeof (channel_pub_key)); 273 = GNUNET_malloc (sizeof (*msg1) + sizeof (channel_pub_key));
274 274
275 memcpy (msg1, msg, sizeof (*msg1) + sizeof (channel_pub_key)); 275 GNUNET_memcpy (msg1, msg, sizeof (*msg1) + sizeof (channel_pub_key));
276 276
277 msg1->fragment_id = GNUNET_htonll (INT64_MAX); 277 msg1->fragment_id = GNUNET_htonll (INT64_MAX);
278 msg1->fragment_offset = GNUNET_htonll (32768); 278 msg1->fragment_offset = GNUNET_htonll (32768);