aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet_common.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/cadet_common.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/cadet_common.c')
-rw-r--r--src/cadet/cadet_common.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cadet/cadet_common.c b/src/cadet/cadet_common.c
index 08e95bbdb..2376722fa 100644
--- a/src/cadet/cadet_common.c
+++ b/src/cadet/cadet_common.c
@@ -81,7 +81,7 @@ const struct GNUNET_HashCode *
81GC_h2hc (const struct GNUNET_CADET_Hash *id) 81GC_h2hc (const struct GNUNET_CADET_Hash *id)
82{ 82{
83 static struct GNUNET_HashCode hc; 83 static struct GNUNET_HashCode hc;
84 memcpy (&hc, id, sizeof (*id)); 84 GNUNET_memcpy (&hc, id, sizeof (*id));
85 85
86 return &hc; 86 return &hc;
87} 87}
@@ -92,7 +92,7 @@ GC_h2s (const struct GNUNET_CADET_Hash *id)
92{ 92{
93 static char s[53]; 93 static char s[53];
94 94
95 memcpy (s, GNUNET_h2s_full (GC_h2hc (id)), 52); 95 GNUNET_memcpy (s, GNUNET_h2s_full (GC_h2hc (id)), 52);
96 s[52] = '\0'; 96 s[52] = '\0';
97 97
98 return s; 98 return s;