aboutsummaryrefslogtreecommitdiff
path: root/src/fragmentation/defragmentation.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/fragmentation/defragmentation.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/fragmentation/defragmentation.c')
-rw-r--r--src/fragmentation/defragmentation.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fragmentation/defragmentation.c b/src/fragmentation/defragmentation.c
index 50fc4a1d5..bc401435e 100644
--- a/src/fragmentation/defragmentation.c
+++ b/src/fragmentation/defragmentation.c
@@ -520,7 +520,7 @@ GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc,
520 { 520 {
521 mc->bits -= 1LLU << bit; 521 mc->bits -= 1LLU << bit;
522 mbuf = (char *) &mc[1]; 522 mbuf = (char *) &mc[1];
523 memcpy (&mbuf[bit * (dc->mtu - sizeof (struct FragmentHeader))], &fh[1], 523 GNUNET_memcpy (&mbuf[bit * (dc->mtu - sizeof (struct FragmentHeader))], &fh[1],
524 ntohs (msg->size) - sizeof (struct FragmentHeader)); 524 ntohs (msg->size) - sizeof (struct FragmentHeader));
525 mc->last_update = now; 525 mc->last_update = now;
526 if (bit < mc->last_bit) 526 if (bit < mc->last_bit)