summaryrefslogtreecommitdiff
path: root/src/cadet
diff options
context:
space:
mode:
Diffstat (limited to 'src/cadet')
-rw-r--r--src/cadet/cadet_api.c6
-rw-r--r--src/cadet/cadet_common.c4
-rw-r--r--src/cadet/cadet_path.c2
-rw-r--r--src/cadet/cadet_tunnel_tree.c2
-rw-r--r--src/cadet/gnunet-cadet-profiler.c2
-rw-r--r--src/cadet/gnunet-cadet.c2
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c6
-rw-r--r--src/cadet/gnunet-service-cadet_connection.c2
-rw-r--r--src/cadet/gnunet-service-cadet_dht.c4
-rw-r--r--src/cadet/gnunet-service-cadet_local.c2
-rw-r--r--src/cadet/gnunet-service-cadet_peer.c4
-rw-r--r--src/cadet/gnunet-service-cadet_tunnel.c6
12 files changed, 21 insertions, 21 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index 960f4788c..1ad3ec5b0 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -1410,7 +1410,7 @@ send_callback (void *cls, size_t size, void *buf)
mh = (const struct GNUNET_MessageHeader *) &th[1];
LOG (GNUNET_ERROR_TYPE_DEBUG, "# cadet internal traffic, type %s\n",
GC_m2s (ntohs (mh->type)));
- memcpy (cbuf, &th[1], th->size);
+ GNUNET_memcpy (cbuf, &th[1], th->size);
psize = th->size;
}
GNUNET_assert (GNUNET_CONSTANTS_MAX_CADET_MESSAGE_SIZE >= psize);
@@ -1478,7 +1478,7 @@ send_packet (struct GNUNET_CADET_Handle *h,
th->timeout = GNUNET_TIME_UNIT_FOREVER_ABS;
th->size = msize;
th->channel = channel;
- memcpy (&th[1], msg, msize);
+ GNUNET_memcpy (&th[1], msg, msize);
add_to_queue (h, th);
if (NULL != h->th)
return;
@@ -2098,7 +2098,7 @@ cadet_mq_ntr (void *cls, size_t size,
}
msize = ntohs (msg->size);
GNUNET_assert (msize <= size);
- memcpy (buf, msg, msize);
+ GNUNET_memcpy (buf, msg, msize);
GNUNET_MQ_impl_send_continue (mq);
return msize;
}
diff --git a/src/cadet/cadet_common.c b/src/cadet/cadet_common.c
index 08e95bbdb..2376722fa 100644
--- a/src/cadet/cadet_common.c
+++ b/src/cadet/cadet_common.c
@@ -81,7 +81,7 @@ const struct GNUNET_HashCode *
GC_h2hc (const struct GNUNET_CADET_Hash *id)
{
static struct GNUNET_HashCode hc;
- memcpy (&hc, id, sizeof (*id));
+ GNUNET_memcpy (&hc, id, sizeof (*id));
return &hc;
}
@@ -92,7 +92,7 @@ GC_h2s (const struct GNUNET_CADET_Hash *id)
{
static char s[53];
- memcpy (s, GNUNET_h2s_full (GC_h2hc (id)), 52);
+ GNUNET_memcpy (s, GNUNET_h2s_full (GC_h2hc (id)), 52);
s[52] = '\0';
return s;
diff --git a/src/cadet/cadet_path.c b/src/cadet/cadet_path.c
index 0358d64ca..277a7665a 100644
--- a/src/cadet/cadet_path.c
+++ b/src/cadet/cadet_path.c
@@ -110,7 +110,7 @@ path_duplicate (const struct CadetPeerPath *path)
unsigned int i;
aux = path_new (path->length);
- memcpy (aux->peers,
+ GNUNET_memcpy (aux->peers,
path->peers,
path->length * sizeof (GNUNET_PEER_Id));
for (i = 0; i < aux->length; i++)
diff --git a/src/cadet/cadet_tunnel_tree.c b/src/cadet/cadet_tunnel_tree.c
index 8ea012a36..81a38e4e8 100644
--- a/src/cadet/cadet_tunnel_tree.c
+++ b/src/cadet/cadet_tunnel_tree.c
@@ -161,7 +161,7 @@ path_duplicate (struct CadetPeerPath *path)
unsigned int i;
aux = path_new (path->length);
- memcpy (aux->peers, path->peers, path->length * sizeof (GNUNET_PEER_Id));
+ GNUNET_memcpy (aux->peers, path->peers, path->length * sizeof (GNUNET_PEER_Id));
for (i = 0; i < path->length; i++)
GNUNET_PEER_change_rc (path->peers[i], 1);
return aux;
diff --git a/src/cadet/gnunet-cadet-profiler.c b/src/cadet/gnunet-cadet-profiler.c
index aa095d190..65e8f3219 100644
--- a/src/cadet/gnunet-cadet-profiler.c
+++ b/src/cadet/gnunet-cadet-profiler.c
@@ -621,7 +621,7 @@ tmt_rdy_pong (void *cls, size_t size, void *buf)
return 0;
}
pong = (struct CadetPingMessage *) buf;
- memcpy (pong, ping, sizeof (*ping));
+ GNUNET_memcpy (pong, ping, sizeof (*ping));
pong->header.type = htons (PONG);
GNUNET_free (ping);
diff --git a/src/cadet/gnunet-cadet.c b/src/cadet/gnunet-cadet.c
index f24975203..cf415448f 100644
--- a/src/cadet/gnunet-cadet.c
+++ b/src/cadet/gnunet-cadet.c
@@ -274,7 +274,7 @@ data_ready (void *cls, size_t size, void *buf)
msg = buf;
msg->size = htons (total_size);
msg->type = htons (GNUNET_MESSAGE_TYPE_CADET_CLI);
- memcpy (&msg[1], cls, data_size);
+ GNUNET_memcpy (&msg[1], cls, data_size);
if (GNUNET_NO == echo)
{
listen_stdio ();
diff --git a/src/cadet/gnunet-service-cadet_channel.c b/src/cadet/gnunet-service-cadet_channel.c
index d4f9754da..3d204e5b3 100644
--- a/src/cadet/gnunet-service-cadet_channel.c
+++ b/src/cadet/gnunet-service-cadet_channel.c
@@ -379,7 +379,7 @@ copy_message (const struct GNUNET_CADET_Data *msg, uint32_t mid,
copy->mid = mid;
copy->rel = rel;
copy->type = GNUNET_MESSAGE_TYPE_CADET_DATA;
- memcpy (&copy[1], msg, size);
+ GNUNET_memcpy (&copy[1], msg, size);
return copy;
}
@@ -1232,7 +1232,7 @@ channel_save_copy (struct CadetChannel *ch,
copy->mid = mid;
copy->rel = rel;
copy->type = type;
- memcpy (&copy[1], msg, size);
+ GNUNET_memcpy (&copy[1], msg, size);
GNUNET_CONTAINER_DLL_insert_tail (rel->head_sent, rel->tail_sent, copy);
ch->pending_messages++;
@@ -1772,7 +1772,7 @@ GCCH_handle_local_data (struct CadetChannel *ch,
payload = (struct GNUNET_CADET_Data *) cbuf;
payload->mid = htonl (rel->mid_send);
rel->mid_send++;
- memcpy (&payload[1], message, size);
+ GNUNET_memcpy (&payload[1], message, size);
payload->header.size = htons (p2p_size);
payload->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_DATA);
payload->chid = htonl (ch->gid);
diff --git a/src/cadet/gnunet-service-cadet_connection.c b/src/cadet/gnunet-service-cadet_connection.c
index 188041feb..9dfecf043 100644
--- a/src/cadet/gnunet-service-cadet_connection.c
+++ b/src/cadet/gnunet-service-cadet_connection.c
@@ -3484,7 +3484,7 @@ GCC_send_prebuilt_message (const struct GNUNET_MessageHeader *message,
GCC_check_connections ();
size = ntohs (message->size);
data = GNUNET_malloc (size);
- memcpy (data, message, size);
+ GNUNET_memcpy (data, message, size);
type = ntohs (message->type);
LOG (GNUNET_ERROR_TYPE_INFO,
"--> %s (%s %4u) on conn %s (%p) %s [%5u]\n",
diff --git a/src/cadet/gnunet-service-cadet_dht.c b/src/cadet/gnunet-service-cadet_dht.c
index da9bf7604..55dd10d33 100644
--- a/src/cadet/gnunet-service-cadet_dht.c
+++ b/src/cadet/gnunet-service-cadet_dht.c
@@ -239,7 +239,7 @@ announce_id (void *cls)
GNUNET_STATISTICS_update (stats, "# DHT announce",
1, GNUNET_NO);
memset (&phash, 0, sizeof (phash));
- memcpy (&phash, &my_full_id, sizeof (my_full_id));
+ GNUNET_memcpy (&phash, &my_full_id, sizeof (my_full_id));
GNUNET_DHT_put (dht_handle, /* DHT handle */
&phash, /* Key to use */
dht_replication_level, /* Replication level */
@@ -352,7 +352,7 @@ GCD_search (const struct GNUNET_PeerIdentity *peer_id,
GNUNET_i2s (peer_id));
GNUNET_STATISTICS_update (stats, "# DHT search", 1, GNUNET_NO);
memset (&phash, 0, sizeof (phash));
- memcpy (&phash, peer_id, sizeof (*peer_id));
+ GNUNET_memcpy (&phash, peer_id, sizeof (*peer_id));
h = GNUNET_new (struct GCD_search_handle);
h->peer_id = GNUNET_PEER_intern (peer_id);
h->callback = callback;
diff --git a/src/cadet/gnunet-service-cadet_local.c b/src/cadet/gnunet-service-cadet_local.c
index 0a7c3d14d..ce1f45a10 100644
--- a/src/cadet/gnunet-service-cadet_local.c
+++ b/src/cadet/gnunet-service-cadet_local.c
@@ -1487,7 +1487,7 @@ GML_send_data (struct CadetClient *c,
return;
}
copy = (struct GNUNET_CADET_LocalData *) cbuf;
- memcpy (&copy[1], &msg[1], size);
+ GNUNET_memcpy (&copy[1], &msg[1], size);
copy->header.size = htons (sizeof (struct GNUNET_CADET_LocalData) + size);
copy->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_DATA);
copy->id = htonl (id);
diff --git a/src/cadet/gnunet-service-cadet_peer.c b/src/cadet/gnunet-service-cadet_peer.c
index 22a8150c4..e19c3ca48 100644
--- a/src/cadet/gnunet-service-cadet_peer.c
+++ b/src/cadet/gnunet-service-cadet_peer.c
@@ -604,7 +604,7 @@ send_core_data_raw (void *cls, size_t size, void *buf)
GNUNET_break (0);
return 0;
}
- memcpy (buf, msg, total_size);
+ GNUNET_memcpy (buf, msg, total_size);
GNUNET_free (cls);
return total_size;
}
@@ -2518,7 +2518,7 @@ GCP_set_hello (struct CadetPeer *peer,
{
size = GNUNET_HELLO_size (hello);
peer->hello = GNUNET_malloc (size);
- memcpy (peer->hello, hello, size);
+ GNUNET_memcpy (peer->hello, hello, size);
}
else
{
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c
index b9f0e1fa2..fe763e655 100644
--- a/src/cadet/gnunet-service-cadet_tunnel.c
+++ b/src/cadet/gnunet-service-cadet_tunnel.c
@@ -923,7 +923,7 @@ t_hmac (const void *plaintext, size_t size,
NULL);
/* Two step: CADET_Hash is only 256 bits, HashCode is 512. */
GNUNET_CRYPTO_hmac (&auth_key, plaintext, size, &hash);
- memcpy (hmac, &hash, sizeof (*hmac));
+ GNUNET_memcpy (hmac, &hash, sizeof (*hmac));
}
@@ -1885,7 +1885,7 @@ queue_data (struct CadetTunnel *t, const struct GNUNET_MessageHeader *msg)
tqd = GNUNET_malloc (sizeof (struct CadetTunnelDelayed) + size);
tqd->t = t;
- memcpy (&tqd[1], msg, size);
+ GNUNET_memcpy (&tqd[1], msg, size);
GNUNET_CONTAINER_DLL_insert_tail (t->tq_head, t->tq_tail, tqd);
return tqd;
}
@@ -2246,7 +2246,7 @@ send_kx (struct CadetTunnel *t,
LOG (GNUNET_ERROR_TYPE_DEBUG, "unkown type %s\n", GC_m2s (type));
GNUNET_assert (0);
}
- memcpy (&msg[1], message, size);
+ GNUNET_memcpy (&msg[1], message, size);
fwd = GCC_is_origin (c, GNUNET_YES);