aboutsummaryrefslogtreecommitdiff
path: root/src/testbed
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/testbed
parent5184c17d32a39c928c2a0fec3ee1ad098bbaa562 (diff)
downloadgnunet-d8c53b12a818ff7cf82d06a1a69c395bdef85ee6.tar.gz
gnunet-d8c53b12a818ff7cf82d06a1a69c395bdef85ee6.zip
-avoid calling memcpy() with NULL argument, even if len is 0
Diffstat (limited to 'src/testbed')
-rw-r--r--src/testbed/gnunet-daemon-testbed-underlay.c2
-rw-r--r--src/testbed/gnunet-service-testbed.c8
-rw-r--r--src/testbed/gnunet-service-testbed_barriers.c14
-rw-r--r--src/testbed/gnunet-service-testbed_connectionpool.c2
-rw-r--r--src/testbed/gnunet-service-testbed_links.c4
-rw-r--r--src/testbed/gnunet-service-testbed_oc.c6
-rw-r--r--src/testbed/testbed_api.c42
-rw-r--r--src/testbed/testbed_api_barriers.c2
-rw-r--r--src/testbed/testbed_api_hosts.c11
-rw-r--r--src/testbed/testbed_api_operations.c2
-rw-r--r--src/testbed/testbed_api_peers.c6
-rw-r--r--src/testbed/testbed_api_testbed.c2
12 files changed, 51 insertions, 50 deletions
diff --git a/src/testbed/gnunet-daemon-testbed-underlay.c b/src/testbed/gnunet-daemon-testbed-underlay.c
index 663ab2d08..b02566fed 100644
--- a/src/testbed/gnunet-daemon-testbed-underlay.c
+++ b/src/testbed/gnunet-daemon-testbed-underlay.c
@@ -170,7 +170,7 @@ get_identity (unsigned int offset, struct GNUNET_PeerIdentity *id)
170 170
171 if (offset >= num_hostkeys) 171 if (offset >= num_hostkeys)
172 return GNUNET_SYSERR; 172 return GNUNET_SYSERR;
173 (void) memcpy (&private_key, 173 GNUNET_memcpy (&private_key,
174 hostkeys_data + (offset * GNUNET_TESTING_HOSTKEYFILESIZE), 174 hostkeys_data + (offset * GNUNET_TESTING_HOSTKEYFILESIZE),
175 GNUNET_TESTING_HOSTKEYFILESIZE); 175 GNUNET_TESTING_HOSTKEYFILESIZE);
176 GNUNET_CRYPTO_eddsa_key_get_public (&private_key, &id->public_key); 176 GNUNET_CRYPTO_eddsa_key_get_public (&private_key, &id->public_key);
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c
index 8a286742c..9e181f85a 100644
--- a/src/testbed/gnunet-service-testbed.c
+++ b/src/testbed/gnunet-service-testbed.c
@@ -151,7 +151,7 @@ transmit_ready_notify (void *cls, size_t size, void *buf)
151 return 0; 151 return 0;
152 GNUNET_assert (ntohs (mq_entry->msg->size) <= size); 152 GNUNET_assert (ntohs (mq_entry->msg->size) <= size);
153 size = ntohs (mq_entry->msg->size); 153 size = ntohs (mq_entry->msg->size);
154 memcpy (buf, mq_entry->msg, size); 154 GNUNET_memcpy (buf, mq_entry->msg, size);
155 GNUNET_free (mq_entry->msg); 155 GNUNET_free (mq_entry->msg);
156 GNUNET_SERVER_client_drop (mq_entry->client); 156 GNUNET_SERVER_client_drop (mq_entry->client);
157 GNUNET_CONTAINER_DLL_remove (mq_head, mq_tail, mq_entry); 157 GNUNET_CONTAINER_DLL_remove (mq_head, mq_tail, mq_entry);
@@ -249,7 +249,7 @@ GST_send_operation_fail_msg (struct GNUNET_SERVER_Client *client,
249 msg->event_type = htonl (GNUNET_TESTBED_ET_OPERATION_FINISHED); 249 msg->event_type = htonl (GNUNET_TESTBED_ET_OPERATION_FINISHED);
250 msg->operation_id = GNUNET_htonll (operation_id); 250 msg->operation_id = GNUNET_htonll (operation_id);
251 if (0 != emsg_len) 251 if (0 != emsg_len)
252 memcpy (&msg[1], emsg, emsg_len); 252 GNUNET_memcpy (&msg[1], emsg, emsg_len);
253 GST_queue_message (client, &msg->header); 253 GST_queue_message (client, &msg->header);
254} 254}
255 255
@@ -435,7 +435,7 @@ parse_shared_services (char *ss_str, struct GNUNET_CONFIGURATION_Handle *cfg)
435#define GROW_SS \ 435#define GROW_SS \
436 do { \ 436 do { \
437 GNUNET_array_grow (slist, n, n+1); \ 437 GNUNET_array_grow (slist, n, n+1); \
438 (void) memcpy (&slist[n - 1], &ss, \ 438 GNUNET_memcpy (&slist[n - 1], &ss, \
439 sizeof (struct GNUNET_TESTING_SharedService)); \ 439 sizeof (struct GNUNET_TESTING_SharedService)); \
440 } while (0) 440 } while (0)
441 441
@@ -649,7 +649,7 @@ handle_add_host (void *cls,
649 GNUNET_TESTBED_host_destroy (host); 649 GNUNET_TESTBED_host_destroy (host);
650 reply_size += strlen (emsg) + 1; 650 reply_size += strlen (emsg) + 1;
651 reply = GNUNET_malloc (reply_size); 651 reply = GNUNET_malloc (reply_size);
652 memcpy (&reply[1], emsg, strlen (emsg) + 1); 652 GNUNET_memcpy (&reply[1], emsg, strlen (emsg) + 1);
653 } 653 }
654 else 654 else
655 { 655 {
diff --git a/src/testbed/gnunet-service-testbed_barriers.c b/src/testbed/gnunet-service-testbed_barriers.c
index d8545ad04..b994a7d15 100644
--- a/src/testbed/gnunet-service-testbed_barriers.c
+++ b/src/testbed/gnunet-service-testbed_barriers.c
@@ -282,7 +282,7 @@ transmit_ready_cb (void *cls, size_t size, void *buf)
282 msg = mq->msg; 282 msg = mq->msg;
283 wrote = ntohs (msg->size); 283 wrote = ntohs (msg->size);
284 GNUNET_assert (size >= wrote); 284 GNUNET_assert (size >= wrote);
285 (void) memcpy (buf, msg, wrote); 285 GNUNET_memcpy (buf, msg, wrote);
286 GNUNET_CONTAINER_DLL_remove (ctx->mq_head, ctx->mq_tail, mq); 286 GNUNET_CONTAINER_DLL_remove (ctx->mq_head, ctx->mq_tail, mq);
287 GNUNET_free (mq->msg); 287 GNUNET_free (mq->msg);
288 GNUNET_free (mq); 288 GNUNET_free (mq);
@@ -418,9 +418,9 @@ send_client_status_msg (struct GNUNET_SERVER_Client *client,
418 msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS); 418 msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS);
419 msg->status = htons (status); 419 msg->status = htons (status);
420 msg->name_len = htons ((uint16_t) name_len); 420 msg->name_len = htons ((uint16_t) name_len);
421 (void) memcpy (msg->data, name, name_len); 421 GNUNET_memcpy (msg->data, name, name_len);
422 if (NULL != emsg) 422 if (NULL != emsg)
423 (void) memcpy (msg->data + name_len + 1, emsg, strlen (emsg)); 423 GNUNET_memcpy (msg->data + name_len + 1, emsg, strlen (emsg));
424 GST_queue_message (client, &msg->header); 424 GST_queue_message (client, &msg->header);
425} 425}
426 426
@@ -481,7 +481,7 @@ handle_barrier_wait (void *cls, struct GNUNET_SERVER_Client *client,
481 name_len = msize - sizeof (struct GNUNET_TESTBED_BarrierWait); 481 name_len = msize - sizeof (struct GNUNET_TESTBED_BarrierWait);
482 name = GNUNET_malloc (name_len + 1); 482 name = GNUNET_malloc (name_len + 1);
483 name[name_len] = '\0'; 483 name[name_len] = '\0';
484 (void) memcpy (name, msg->name, name_len); 484 GNUNET_memcpy (name, msg->name, name_len);
485 LOG_DEBUG ("Received BARRIER_WAIT for barrier `%s'\n", name); 485 LOG_DEBUG ("Received BARRIER_WAIT for barrier `%s'\n", name);
486 GNUNET_CRYPTO_hash (name, name_len, &key); 486 GNUNET_CRYPTO_hash (name, name_len, &key);
487 GNUNET_free (name); 487 GNUNET_free (name);
@@ -734,7 +734,7 @@ GST_handle_barrier_init (void *cls, struct GNUNET_SERVER_Client *client,
734 msg = (const struct GNUNET_TESTBED_BarrierInit *) message; 734 msg = (const struct GNUNET_TESTBED_BarrierInit *) message;
735 name_len = (size_t) msize - sizeof (struct GNUNET_TESTBED_BarrierInit); 735 name_len = (size_t) msize - sizeof (struct GNUNET_TESTBED_BarrierInit);
736 name = GNUNET_malloc (name_len + 1); 736 name = GNUNET_malloc (name_len + 1);
737 (void) memcpy (name, msg->name, name_len); 737 GNUNET_memcpy (name, msg->name, name_len);
738 GNUNET_CRYPTO_hash (name, name_len, &hash); 738 GNUNET_CRYPTO_hash (name, name_len, &hash);
739 LOG_DEBUG ("Received BARRIER_INIT for barrier `%s'\n", name); 739 LOG_DEBUG ("Received BARRIER_INIT for barrier `%s'\n", name);
740 if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (barrier_map, &hash)) 740 if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (barrier_map, &hash))
@@ -747,7 +747,7 @@ GST_handle_barrier_init (void *cls, struct GNUNET_SERVER_Client *client,
747 return; 747 return;
748 } 748 }
749 barrier = GNUNET_new (struct Barrier); 749 barrier = GNUNET_new (struct Barrier);
750 (void) memcpy (&barrier->hash, &hash, sizeof (struct GNUNET_HashCode)); 750 GNUNET_memcpy (&barrier->hash, &hash, sizeof (struct GNUNET_HashCode));
751 barrier->quorum = msg->quorum; 751 barrier->quorum = msg->quorum;
752 barrier->name = name; 752 barrier->name = name;
753 barrier->mc = client; 753 barrier->mc = client;
@@ -836,7 +836,7 @@ GST_handle_barrier_cancel (void *cls, struct GNUNET_SERVER_Client *client,
836 msg = (const struct GNUNET_TESTBED_BarrierCancel *) message; 836 msg = (const struct GNUNET_TESTBED_BarrierCancel *) message;
837 name_len = msize - sizeof (struct GNUNET_TESTBED_BarrierCancel); 837 name_len = msize - sizeof (struct GNUNET_TESTBED_BarrierCancel);
838 name = GNUNET_malloc (name_len + 1); 838 name = GNUNET_malloc (name_len + 1);
839 (void) memcpy (name, msg->name, name_len); 839 GNUNET_memcpy (name, msg->name, name_len);
840 GNUNET_CRYPTO_hash (name, name_len, &hash); 840 GNUNET_CRYPTO_hash (name, name_len, &hash);
841 if (GNUNET_NO == GNUNET_CONTAINER_multihashmap_contains (barrier_map, &hash)) 841 if (GNUNET_NO == GNUNET_CONTAINER_multihashmap_contains (barrier_map, &hash))
842 { 842 {
diff --git a/src/testbed/gnunet-service-testbed_connectionpool.c b/src/testbed/gnunet-service-testbed_connectionpool.c
index 47b6fab08..f060cb3f5 100644
--- a/src/testbed/gnunet-service-testbed_connectionpool.c
+++ b/src/testbed/gnunet-service-testbed_connectionpool.c
@@ -629,7 +629,7 @@ core_startup_cb (void *cls,
629 } 629 }
630 GNUNET_assert (NULL == entry->peer_identity); 630 GNUNET_assert (NULL == entry->peer_identity);
631 entry->peer_identity = GNUNET_new (struct GNUNET_PeerIdentity); 631 entry->peer_identity = GNUNET_new (struct GNUNET_PeerIdentity);
632 memcpy (entry->peer_identity, 632 GNUNET_memcpy (entry->peer_identity,
633 my_identity, 633 my_identity,
634 sizeof (struct GNUNET_PeerIdentity)); 634 sizeof (struct GNUNET_PeerIdentity));
635 if (0 == entry->demand) 635 if (0 == entry->demand)
diff --git a/src/testbed/gnunet-service-testbed_links.c b/src/testbed/gnunet-service-testbed_links.c
index a2692e8a6..b922a8da8 100644
--- a/src/testbed/gnunet-service-testbed_links.c
+++ b/src/testbed/gnunet-service-testbed_links.c
@@ -572,11 +572,11 @@ send_controller_link_response (struct GNUNET_SERVER_Client *client,
572 msg->config_size = htons ((uint16_t) config_size); 572 msg->config_size = htons ((uint16_t) config_size);
573 if (NULL != xconfig) 573 if (NULL != xconfig)
574 { 574 {
575 memcpy (&msg[1], xconfig, xconfig_size); 575 GNUNET_memcpy (&msg[1], xconfig, xconfig_size);
576 GNUNET_free (xconfig); 576 GNUNET_free (xconfig);
577 } 577 }
578 if (NULL != emsg) 578 if (NULL != emsg)
579 memcpy (&msg[1], emsg, strlen (emsg)); 579 GNUNET_memcpy (&msg[1], emsg, strlen (emsg));
580 GST_queue_message (client, &msg->header); 580 GST_queue_message (client, &msg->header);
581} 581}
582 582
diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c
index 8902a359c..2f4062abe 100644
--- a/src/testbed/gnunet-service-testbed_oc.c
+++ b/src/testbed/gnunet-service-testbed_oc.c
@@ -866,7 +866,7 @@ send_hello_thru_rocc (struct OverlayConnectContext *occ)
866 msg->peer = htonl (occ->other_peer_id); 866 msg->peer = htonl (occ->other_peer_id);
867 msg->operation_id = GNUNET_htonll (occ->op_id); 867 msg->operation_id = GNUNET_htonll (occ->op_id);
868 msg->peer_identity = occ->peer_identity; 868 msg->peer_identity = occ->peer_identity;
869 memcpy (msg->hello, 869 GNUNET_memcpy (msg->hello,
870 occ->hello, 870 occ->hello,
871 hello_size); 871 hello_size);
872 GNUNET_TESTBED_queue_message_ (occ->p2ctx.remote.p2c, 872 GNUNET_TESTBED_queue_message_ (occ->p2ctx.remote.p2c,
@@ -1053,7 +1053,7 @@ hello_update_cb (void *cls,
1053 GNUNET_i2s (&occ->peer_identity)); 1053 GNUNET_i2s (&occ->peer_identity));
1054 occ->hello = GNUNET_malloc (msize); 1054 occ->hello = GNUNET_malloc (msize);
1055 GST_cache_add_hello (occ->peer->id, hello); 1055 GST_cache_add_hello (occ->peer->id, hello);
1056 memcpy (occ->hello, hello, msize); 1056 GNUNET_memcpy (occ->hello, hello, msize);
1057 GNUNET_TRANSPORT_get_hello_cancel (occ->ghh); 1057 GNUNET_TRANSPORT_get_hello_cancel (occ->ghh);
1058 occ->ghh = NULL; 1058 occ->ghh = NULL;
1059 GST_connection_pool_get_handle_done (occ->cgh_p1th); 1059 GST_connection_pool_get_handle_done (occ->cgh_p1th);
@@ -1895,7 +1895,7 @@ GST_handle_remote_overlay_connect (void *cls,
1895 rocc->peer = peer; 1895 rocc->peer = peer;
1896 rocc->peer->reference_cnt++; 1896 rocc->peer->reference_cnt++;
1897 rocc->hello = GNUNET_malloc (hsize); 1897 rocc->hello = GNUNET_malloc (hsize);
1898 memcpy (rocc->hello, msg->hello, hsize); 1898 GNUNET_memcpy (rocc->hello, msg->hello, hsize);
1899 rocc->tcc.cgh_p2_th = 1899 rocc->tcc.cgh_p2_th =
1900 GST_connection_pool_get_handle (peer_id, 1900 GST_connection_pool_get_handle (peer_id,
1901 rocc->peer->details.local.cfg, 1901 rocc->peer->details.local.cfg,
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c
index 6fec82ab2..895800514 100644
--- a/src/testbed/testbed_api.c
+++ b/src/testbed/testbed_api.c
@@ -812,7 +812,7 @@ handle_peer_config (void *cls,
812 { 812 {
813 case GNUNET_TESTBED_PIT_IDENTITY: 813 case GNUNET_TESTBED_PIT_IDENTITY:
814 pinfo->result.id = GNUNET_new (struct GNUNET_PeerIdentity); 814 pinfo->result.id = GNUNET_new (struct GNUNET_PeerIdentity);
815 (void) memcpy (pinfo->result.id, 815 GNUNET_memcpy (pinfo->result.id,
816 &msg->peer_identity, 816 &msg->peer_identity,
817 sizeof (struct GNUNET_PeerIdentity)); 817 sizeof (struct GNUNET_PeerIdentity));
818 break; 818 break;
@@ -1143,9 +1143,9 @@ handle_link_controllers_result (void *cls,
1143 emsg = GNUNET_malloc (ntohs (msg->header.size) 1143 emsg = GNUNET_malloc (ntohs (msg->header.size)
1144 - sizeof (struct 1144 - sizeof (struct
1145 GNUNET_TESTBED_ControllerLinkResponse) + 1); 1145 GNUNET_TESTBED_ControllerLinkResponse) + 1);
1146 memcpy (emsg, &msg[1], ntohs (msg->header.size) 1146 GNUNET_memcpy (emsg,
1147 - sizeof (struct 1147 &msg[1],
1148 GNUNET_TESTBED_ControllerLinkResponse)); 1148 ntohs (msg->header.size)- sizeof (struct GNUNET_TESTBED_ControllerLinkResponse));
1149 event.details.operation_finished.emsg = emsg; 1149 event.details.operation_finished.emsg = emsg;
1150 } 1150 }
1151 else 1151 else
@@ -1279,9 +1279,9 @@ handle_barrier_status (void *cls,
1279 goto cleanup; 1279 goto cleanup;
1280 } 1280 }
1281 emsg = GNUNET_malloc (emsg_len); 1281 emsg = GNUNET_malloc (emsg_len);
1282 memcpy (emsg, 1282 GNUNET_memcpy (emsg,
1283 msg->data + name_len + 1, 1283 msg->data + name_len + 1,
1284 emsg_len); 1284 emsg_len);
1285 } 1285 }
1286 if (NULL == c->barrier_map) 1286 if (NULL == c->barrier_map)
1287 { 1287 {
@@ -1332,7 +1332,7 @@ GNUNET_TESTBED_queue_message_ (struct GNUNET_TESTBED_Controller *controller,
1332 env = GNUNET_MQ_msg_extra (m2, 1332 env = GNUNET_MQ_msg_extra (m2,
1333 size - sizeof (*m2), 1333 size - sizeof (*m2),
1334 type); 1334 type);
1335 memcpy (m2, msg, size); 1335 GNUNET_memcpy (m2, msg, size);
1336 GNUNET_free (msg); 1336 GNUNET_free (msg);
1337 GNUNET_MQ_send (controller->mq, 1337 GNUNET_MQ_send (controller->mq,
1338 env); 1338 env);
@@ -1370,9 +1370,9 @@ GNUNET_TESTBED_forward_operation_msg_ (struct GNUNET_TESTBED_Controller *control
1370 env = GNUNET_MQ_msg_extra (m2, 1370 env = GNUNET_MQ_msg_extra (m2,
1371 size - sizeof (*m2), 1371 size - sizeof (*m2),
1372 type); 1372 type);
1373 memcpy (m2, 1373 GNUNET_memcpy (m2,
1374 msg, 1374 msg,
1375 size); 1375 size);
1376 GNUNET_MQ_send (controller->mq, 1376 GNUNET_MQ_send (controller->mq,
1377 env); 1377 env);
1378 data = GNUNET_new (struct ForwardedOperationData); 1378 data = GNUNET_new (struct ForwardedOperationData);
@@ -1668,9 +1668,9 @@ GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host,
1668 GNUNET_MESSAGE_TYPE_TESTBED_INIT); 1668 GNUNET_MESSAGE_TYPE_TESTBED_INIT);
1669 msg->host_id = htonl (GNUNET_TESTBED_host_get_id_ (host)); 1669 msg->host_id = htonl (GNUNET_TESTBED_host_get_id_ (host));
1670 msg->event_mask = GNUNET_htonll (controller->event_mask); 1670 msg->event_mask = GNUNET_htonll (controller->event_mask);
1671 memcpy (&msg[1], 1671 GNUNET_memcpy (&msg[1],
1672 controller_hostname, 1672 controller_hostname,
1673 slen); 1673 slen);
1674 GNUNET_MQ_send (controller->mq, 1674 GNUNET_MQ_send (controller->mq,
1675 env); 1675 env);
1676 return controller; 1676 return controller;
@@ -2392,7 +2392,7 @@ GNUNET_TESTBED_barrier_init_ (struct GNUNET_TESTBED_Controller *controller,
2392 barrier->cb = cb; 2392 barrier->cb = cb;
2393 barrier->cls = cls; 2393 barrier->cls = cls;
2394 barrier->echo = echo; 2394 barrier->echo = echo;
2395 (void) memcpy (&barrier->key, &key, sizeof (struct GNUNET_HashCode)); 2395 GNUNET_memcpy (&barrier->key, &key, sizeof (struct GNUNET_HashCode));
2396 GNUNET_assert (GNUNET_OK == 2396 GNUNET_assert (GNUNET_OK ==
2397 GNUNET_CONTAINER_multihashmap_put (controller->barrier_map, 2397 GNUNET_CONTAINER_multihashmap_put (controller->barrier_map,
2398 &barrier->key, 2398 &barrier->key,
@@ -2403,9 +2403,9 @@ GNUNET_TESTBED_barrier_init_ (struct GNUNET_TESTBED_Controller *controller,
2403 name_len, 2403 name_len,
2404 GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT); 2404 GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT);
2405 msg->quorum = (uint8_t) quorum; 2405 msg->quorum = (uint8_t) quorum;
2406 memcpy (msg->name, 2406 GNUNET_memcpy (msg->name,
2407 barrier->name, 2407 barrier->name,
2408 name_len); 2408 name_len);
2409 GNUNET_MQ_send (barrier->c->mq, 2409 GNUNET_MQ_send (barrier->c->mq,
2410 env); 2410 env);
2411 return barrier; 2411 return barrier;
@@ -2453,9 +2453,9 @@ GNUNET_TESTBED_barrier_cancel (struct GNUNET_TESTBED_Barrier *barrier)
2453 env = GNUNET_MQ_msg_extra (msg, 2453 env = GNUNET_MQ_msg_extra (msg,
2454 slen, 2454 slen,
2455 GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_CANCEL); 2455 GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_CANCEL);
2456 memcpy (msg->name, 2456 GNUNET_memcpy (msg->name,
2457 barrier->name, 2457 barrier->name,
2458 slen); 2458 slen);
2459 GNUNET_MQ_send (barrier->c->mq, 2459 GNUNET_MQ_send (barrier->c->mq,
2460 env); 2460 env);
2461 GNUNET_TESTBED_barrier_remove_ (barrier); 2461 GNUNET_TESTBED_barrier_remove_ (barrier);
diff --git a/src/testbed/testbed_api_barriers.c b/src/testbed/testbed_api_barriers.c
index 74139cc53..ee75e515c 100644
--- a/src/testbed/testbed_api_barriers.c
+++ b/src/testbed/testbed_api_barriers.c
@@ -225,7 +225,7 @@ GNUNET_TESTBED_barrier_wait (const char *name,
225 env = GNUNET_MQ_msg_extra (msg, 225 env = GNUNET_MQ_msg_extra (msg,
226 name_len, 226 name_len,
227 GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_WAIT); 227 GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_WAIT);
228 memcpy (msg->name, 228 GNUNET_memcpy (msg->name,
229 name, 229 name,
230 name_len); 230 name_len);
231 GNUNET_MQ_send (h->mq, 231 GNUNET_MQ_send (h->mq,
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c
index 4e14a4d4d..731944bc4 100644
--- a/src/testbed/testbed_api_hosts.c
+++ b/src/testbed/testbed_api_hosts.c
@@ -498,8 +498,9 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename,
498 if (NULL == starting_host) 498 if (NULL == starting_host)
499 return 0; 499 return 0;
500 *hosts = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Host *) * count); 500 *hosts = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Host *) * count);
501 memcpy (*hosts, &host_list[GNUNET_TESTBED_host_get_id_ (starting_host)], 501 GNUNET_memcpy (*hosts,
502 sizeof (struct GNUNET_TESTBED_Host *) * count); 502 &host_list[GNUNET_TESTBED_host_get_id_ (starting_host)],
503 sizeof (struct GNUNET_TESTBED_Host *) * count);
503 return count; 504 return count;
504} 505}
505 506
@@ -1454,14 +1455,14 @@ GNUNET_TESTBED_register_host (struct GNUNET_TESTBED_Controller *controller,
1454 if (NULL != username) 1455 if (NULL != username)
1455 { 1456 {
1456 msg->username_length = htons (username_length); 1457 msg->username_length = htons (username_length);
1457 ptr = memcpy (ptr, username, username_length); 1458 GNUNET_memcpy (ptr, username, username_length);
1458 ptr += username_length; 1459 ptr += username_length;
1459 } 1460 }
1460 msg->hostname_length = htons (hostname_length); 1461 msg->hostname_length = htons (hostname_length);
1461 ptr = memcpy (ptr, hostname, hostname_length); 1462 GNUNET_memcpy (ptr, hostname, hostname_length);
1462 ptr += hostname_length; 1463 ptr += hostname_length;
1463 msg->config_size = htons (config_size); 1464 msg->config_size = htons (config_size);
1464 ptr = memcpy (ptr, cconfig, cc_size); 1465 GNUNET_memcpy (ptr, cconfig, cc_size);
1465 ptr += cc_size; 1466 ptr += cc_size;
1466 GNUNET_assert ((ptr - (void *) msg) == msg_size); 1467 GNUNET_assert ((ptr - (void *) msg) == msg_size);
1467 GNUNET_free (cconfig); 1468 GNUNET_free (cconfig);
diff --git a/src/testbed/testbed_api_operations.c b/src/testbed/testbed_api_operations.c
index 542f35b3c..de24517d6 100644
--- a/src/testbed/testbed_api_operations.c
+++ b/src/testbed/testbed_api_operations.c
@@ -1257,7 +1257,7 @@ GNUNET_TESTBED_operation_inactivate_ (struct GNUNET_TESTBED_Operation *op)
1257 queues = GNUNET_malloc (ms); 1257 queues = GNUNET_malloc (ms);
1258 /* Cloning is needed as the operation be released by waiting operations and 1258 /* Cloning is needed as the operation be released by waiting operations and
1259 hence its nqueues memory ptr will be freed */ 1259 hence its nqueues memory ptr will be freed */
1260 GNUNET_assert (NULL != (queues = memcpy (queues, op->queues, ms))); 1260 GNUNET_memcpy (queues, op->queues, ms);
1261 for (i = 0; i < nqueues; i++) 1261 for (i = 0; i < nqueues; i++)
1262 recheck_waiting (queues[i]); 1262 recheck_waiting (queues[i]);
1263 GNUNET_free (queues); 1263 GNUNET_free (queues);
diff --git a/src/testbed/testbed_api_peers.c b/src/testbed/testbed_api_peers.c
index c30f960c8..2af62b44a 100644
--- a/src/testbed/testbed_api_peers.c
+++ b/src/testbed/testbed_api_peers.c
@@ -122,7 +122,7 @@ opstart_peer_create (void *cls)
122 msg->host_id = htonl (GNUNET_TESTBED_host_get_id_ (data->peer->host)); 122 msg->host_id = htonl (GNUNET_TESTBED_host_get_id_ (data->peer->host));
123 msg->peer_id = htonl (data->peer->unique_id); 123 msg->peer_id = htonl (data->peer->unique_id);
124 msg->config_size = htons ((uint16_t) c_size); 124 msg->config_size = htons ((uint16_t) c_size);
125 memcpy (&msg[1], 125 GNUNET_memcpy (&msg[1],
126 xconfig, 126 xconfig,
127 xc_size); 127 xc_size);
128 GNUNET_MQ_send (opc->c->mq, 128 GNUNET_MQ_send (opc->c->mq,
@@ -489,7 +489,7 @@ opstart_peer_reconfigure (void *cls)
489 msg->peer_id = htonl (data->peer->unique_id); 489 msg->peer_id = htonl (data->peer->unique_id);
490 msg->operation_id = GNUNET_htonll (opc->id); 490 msg->operation_id = GNUNET_htonll (opc->id);
491 msg->config_size = htons (data->cfg_size); 491 msg->config_size = htons (data->cfg_size);
492 memcpy (&msg[1], 492 GNUNET_memcpy (&msg[1],
493 xconfig, 493 xconfig,
494 xc_size); 494 xc_size);
495 GNUNET_free (xconfig); 495 GNUNET_free (xconfig);
@@ -898,7 +898,7 @@ opstart_manage_service (void *cls)
898 msg->peer_id = htonl (data->peer->unique_id); 898 msg->peer_id = htonl (data->peer->unique_id);
899 msg->operation_id = GNUNET_htonll (opc->id); 899 msg->operation_id = GNUNET_htonll (opc->id);
900 msg->start = (uint8_t) data->start; 900 msg->start = (uint8_t) data->start;
901 memcpy (&msg[1], 901 GNUNET_memcpy (&msg[1],
902 data->service_name, 902 data->service_name,
903 xlen); 903 xlen);
904 GNUNET_free (data->service_name); 904 GNUNET_free (data->service_name);
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c
index b3b2c3987..1b6656234 100644
--- a/src/testbed/testbed_api_testbed.c
+++ b/src/testbed/testbed_api_testbed.c
@@ -1158,7 +1158,7 @@ host_habitable_cb (void *cls, const struct GNUNET_TESTBED_Host *host,
1158 old_hosts = rc->hosts; 1158 old_hosts = rc->hosts;
1159 rc->hosts = 1159 rc->hosts =
1160 GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Host *) * rc->num_hosts); 1160 GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Host *) * rc->num_hosts);
1161 memcpy (rc->hosts, &old_hosts[1], 1161 GNUNET_memcpy (rc->hosts, &old_hosts[1],
1162 (sizeof (struct GNUNET_TESTBED_Host *) * rc->num_hosts)); 1162 (sizeof (struct GNUNET_TESTBED_Host *) * rc->num_hosts));
1163 GNUNET_free (old_hosts); 1163 GNUNET_free (old_hosts);
1164 } 1164 }