aboutsummaryrefslogtreecommitdiff
path: root/src/gnsrecord/gnsrecord_serialization.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/gnsrecord/gnsrecord_serialization.c
parent5184c17d32a39c928c2a0fec3ee1ad098bbaa562 (diff)
-avoid calling memcpy() with NULL argument, even if len is 0
Diffstat (limited to 'src/gnsrecord/gnsrecord_serialization.c')
-rw-r--r--src/gnsrecord/gnsrecord_serialization.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gnsrecord/gnsrecord_serialization.c b/src/gnsrecord/gnsrecord_serialization.c
index ccecf87aad..e2cabafd36 100644
--- a/src/gnsrecord/gnsrecord_serialization.c
+++ b/src/gnsrecord/gnsrecord_serialization.c
@@ -132,11 +132,11 @@ GNUNET_GNSRECORD_records_serialize (unsigned int rd_count,
rec.flags = htonl (rd[i].flags);
if (off + sizeof (rec) > dest_size)
return -1;
- memcpy (&dest[off], &rec, sizeof (rec));
+ GNUNET_memcpy (&dest[off], &rec, sizeof (rec));
off += sizeof (rec);
if (off + rd[i].data_size > dest_size)
return -1;
- memcpy (&dest[off], rd[i].data, rd[i].data_size);
+ GNUNET_memcpy (&dest[off], rd[i].data, rd[i].data_size);
off += rd[i].data_size;
}
return off;
@@ -167,7 +167,7 @@ GNUNET_GNSRECORD_records_deserialize (size_t len,
{
if (off + sizeof (rec) > len)
return GNUNET_SYSERR;
- memcpy (&rec, &src[off], sizeof (rec));
+ GNUNET_memcpy (&rec, &src[off], sizeof (rec));
dest[i].expiration_time = GNUNET_ntohll (rec.expiration_time);
dest[i].data_size = ntohl ((uint32_t) rec.data_size);
dest[i].record_type = ntohl (rec.record_type);