summaryrefslogtreecommitdiff
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
parent2a2708dde105c46cee19dd09ee792da2e6c93f8f (diff)
-zero-terminate
-rw-r--r--configure.ac2
-rw-r--r--src/util/gnunet-ecc.c3
2 files changed, 3 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 9c0bdc1b1..9bfbd31c3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1224,7 +1224,7 @@ AC_DEFINE_UNQUOTED([ENABLE_MALICIOUS], [$malicious],
# should services be started by default when a peer starts? Some services may
# choose to never start by default and it is upto the service/module developer to
-# decide it by having "AUTOSTART = NO" instead of "AUTOSTART = @AUTOSTART" in
+# decide it by having "AUTOSTART = NO" instead of "AUTOSTART = @AUTOSTART@" in
# the service/module's conf.in file.
AUTOSTART="YES"
AC_MSG_CHECKING(whether to auto-start peer's services by default)
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)
if (NULL != prefix)
{
strncpy (vanity, prefix, KEY_STR_LEN);
- len = strlen (vanity);
+ len = GNUNET_MIN (strlen (prefix), KEY_STR_LEN);
n = len * 5 / 8;
rest = len * 5 % 8;
memset (&vanity[len], '0', KEY_STR_LEN - len);
+ vanity[KEY_STR_LEN] = '\0';
GNUNET_assert (GNUNET_OK ==
GNUNET_CRYPTO_eddsa_public_key_from_string (vanity,
KEY_STR_LEN,