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/regex/regex_block_lib.c | |
parent | 5184c17d32a39c928c2a0fec3ee1ad098bbaa562 (diff) |
-avoid calling memcpy() with NULL argument, even if len is 0
Diffstat (limited to 'src/regex/regex_block_lib.c')
-rw-r--r-- | src/regex/regex_block_lib.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/regex/regex_block_lib.c b/src/regex/regex_block_lib.c index cc9e1a08ef..d545c89de0 100644 --- a/src/regex/regex_block_lib.c +++ b/src/regex/regex_block_lib.c @@ -448,17 +448,17 @@ REGEX_BLOCK_create (const char *proof, block->num_edges = htons (num_edges); block->num_destinations = htons (unique_destinations); dests = (struct GNUNET_HashCode *) &block[1]; - memcpy (dests, destinations, sizeof (struct GNUNET_HashCode) * unique_destinations); + GNUNET_memcpy (dests, destinations, sizeof (struct GNUNET_HashCode) * unique_destinations); edgeinfos = (struct EdgeInfo *) &dests[unique_destinations]; aux = (char *) &edgeinfos[num_edges]; off = len; - memcpy (aux, proof, len); + GNUNET_memcpy (aux, proof, len); for (i=0;i<num_edges;i++) { slen = strlen (edges[i].label); edgeinfos[i].token_length = htons ((uint16_t) slen); edgeinfos[i].destination_index = htons (destination_indices[i]); - memcpy (&aux[off], + GNUNET_memcpy (&aux[off], edges[i].label, slen); off += slen; |