From 8465e25bec93716b299e6bdddd832cf84fc5d58c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 7 Dec 2014 21:30:34 +0000 Subject: -zero-terminate --- configure.ac | 2 +- src/util/gnunet-ecc.c | 3 ++- 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, -- cgit v1.2.3