gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r34497 - in gnunet: . src/util


From: gnunet
Subject: [GNUnet-SVN] r34497 - in gnunet: . src/util
Date: Sun, 7 Dec 2014 22:30:35 +0100

Author: grothoff
Date: 2014-12-07 22:30:34 +0100 (Sun, 07 Dec 2014)
New Revision: 34497

Modified:
   gnunet/configure.ac
   gnunet/src/util/gnunet-ecc.c
Log:
-zero-terminate

Modified: gnunet/configure.ac
===================================================================
--- gnunet/configure.ac 2014-12-07 21:23:24 UTC (rev 34496)
+++ gnunet/configure.ac 2014-12-07 21:30:34 UTC (rev 34497)
@@ -1224,7 +1224,7 @@
 
 # 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)

Modified: gnunet/src/util/gnunet-ecc.c
===================================================================
--- gnunet/src/util/gnunet-ecc.c        2014-12-07 21:23:24 UTC (rev 34496)
+++ gnunet/src/util/gnunet-ecc.c        2014-12-07 21:30:34 UTC (rev 34497)
@@ -84,11 +84,12 @@
   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,




reply via email to

[Prev in Thread] Current Thread [Next in Thread]