diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-07-08 17:20:23 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-07-08 17:20:23 +0000 |
commit | d8c53b12a818ff7cf82d06a1a69c395bdef85ee6 (patch) | |
tree | 0ebb0db416c157fcfde51a941185819dd12d51fd /src/fs/gnunet-service-fs_cp.c | |
parent | 5184c17d32a39c928c2a0fec3ee1ad098bbaa562 (diff) |
-avoid calling memcpy() with NULL argument, even if len is 0
Diffstat (limited to 'src/fs/gnunet-service-fs_cp.c')
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index ceb74a2714..bda33d7664 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c @@ -780,7 +780,7 @@ copy_reply (void *cls, { GNUNET_assert (buf_size >= ntohs (pm->header.size)); size = ntohs (pm->header.size); - memcpy (buf, pm, size); + GNUNET_memcpy (buf, pm, size); GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# replies transmitted to other peers"), 1, @@ -1005,7 +1005,7 @@ handle_p2p_reply (void *cls, pm->header.size = htons (msize); pm->type = htonl (type); pm->expiration = GNUNET_TIME_absolute_hton (expiration); - memcpy (&pm[1], data, data_len); + GNUNET_memcpy (&pm[1], data, data_len); if ( (UINT32_MAX != reply_anonymity_level) && (0 != reply_anonymity_level) && (GNUNET_YES == GSF_enable_randomized_delays) ) @@ -1908,7 +1908,7 @@ create_migration_stop_message (void *cls, msm.duration = GNUNET_TIME_relative_hton (GNUNET_TIME_absolute_get_remaining (cp->last_migration_block)); - memcpy (buf, &msm, sizeof (struct MigrationStopMessage)); + GNUNET_memcpy (buf, &msm, sizeof (struct MigrationStopMessage)); GNUNET_STATISTICS_update (GSF_stats, gettext_noop ("# migration stop messages sent"), 1, GNUNET_NO); |