aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-07 21:30:34 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-07 21:30:34 +0000
commit8465e25bec93716b299e6bdddd832cf84fc5d58c (patch)
tree082346a4f788b1b9e1563b9bd473aab477718b26 /src
parent2a2708dde105c46cee19dd09ee792da2e6c93f8f (diff)
downloadgnunet-8465e25bec93716b299e6bdddd832cf84fc5d58c.tar.gz
gnunet-8465e25bec93716b299e6bdddd832cf84fc5d58c.zip
-zero-terminate
Diffstat (limited to 'src')
-rw-r--r--src/util/gnunet-ecc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/gnunet-ecc.c b/src/util/gnunet-ecc.c
index 28355a9d8..f725e4ff3 100644
--- a/src/util/gnunet-ecc.c
+++ b/src/util/gnunet-ecc.c
@@ -84,11 +84,12 @@ create_keys (const char *fn, const char *prefix)
84 if (NULL != prefix) 84 if (NULL != prefix)
85 { 85 {
86 strncpy (vanity, prefix, KEY_STR_LEN); 86 strncpy (vanity, prefix, KEY_STR_LEN);
87 len = strlen (vanity); 87 len = GNUNET_MIN (strlen (prefix), KEY_STR_LEN);
88 n = len * 5 / 8; 88 n = len * 5 / 8;
89 rest = len * 5 % 8; 89 rest = len * 5 % 8;
90 90
91 memset (&vanity[len], '0', KEY_STR_LEN - len); 91 memset (&vanity[len], '0', KEY_STR_LEN - len);
92 vanity[KEY_STR_LEN] = '\0';
92 GNUNET_assert (GNUNET_OK == 93 GNUNET_assert (GNUNET_OK ==
93 GNUNET_CRYPTO_eddsa_public_key_from_string (vanity, 94 GNUNET_CRYPTO_eddsa_public_key_from_string (vanity,
94 KEY_STR_LEN, 95 KEY_STR_LEN,