aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/gnunet-service-cadet_channel.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/cadet/gnunet-service-cadet_channel.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/cadet/gnunet-service-cadet_channel.c')
-rw-r--r--src/cadet/gnunet-service-cadet_channel.c6
1 files changed, 3 insertions, 3 deletions
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,
379 copy->mid = mid; 379 copy->mid = mid;
380 copy->rel = rel; 380 copy->rel = rel;
381 copy->type = GNUNET_MESSAGE_TYPE_CADET_DATA; 381 copy->type = GNUNET_MESSAGE_TYPE_CADET_DATA;
382 memcpy (&copy[1], msg, size); 382 GNUNET_memcpy (&copy[1], msg, size);
383 383
384 return copy; 384 return copy;
385} 385}
@@ -1232,7 +1232,7 @@ channel_save_copy (struct CadetChannel *ch,
1232 copy->mid = mid; 1232 copy->mid = mid;
1233 copy->rel = rel; 1233 copy->rel = rel;
1234 copy->type = type; 1234 copy->type = type;
1235 memcpy (&copy[1], msg, size); 1235 GNUNET_memcpy (&copy[1], msg, size);
1236 GNUNET_CONTAINER_DLL_insert_tail (rel->head_sent, rel->tail_sent, copy); 1236 GNUNET_CONTAINER_DLL_insert_tail (rel->head_sent, rel->tail_sent, copy);
1237 ch->pending_messages++; 1237 ch->pending_messages++;
1238 1238
@@ -1772,7 +1772,7 @@ GCCH_handle_local_data (struct CadetChannel *ch,
1772 payload = (struct GNUNET_CADET_Data *) cbuf; 1772 payload = (struct GNUNET_CADET_Data *) cbuf;
1773 payload->mid = htonl (rel->mid_send); 1773 payload->mid = htonl (rel->mid_send);
1774 rel->mid_send++; 1774 rel->mid_send++;
1775 memcpy (&payload[1], message, size); 1775 GNUNET_memcpy (&payload[1], message, size);
1776 payload->header.size = htons (p2p_size); 1776 payload->header.size = htons (p2p_size);
1777 payload->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_DATA); 1777 payload->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_DATA);
1778 payload->chid = htonl (ch->gid); 1778 payload->chid = htonl (ch->gid);