gnunet-svn
[Top][All Lists]
Advanced

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

[taler-anastasis] 01/06: fix strncpy warnings


From: gnunet
Subject: [taler-anastasis] 01/06: fix strncpy warnings
Date: Thu, 22 Oct 2020 18:52:06 +0200

This is an automated email from the git hooks/post-receive script.

dennis-neufeld pushed a commit to branch master
in repository anastasis.

commit 3a30ce37920b1d16edece56c6a23c4e4832d6fcd
Author: Dennis Neufeld <dennis.neufeld@students.bfh.ch>
AuthorDate: Wed Oct 21 16:02:56 2020 +0200

    fix strncpy warnings
---
 src/lib/anastasis.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/lib/anastasis.c b/src/lib/anastasis.c
index 5e3dd99..6b080ab 100644
--- a/src/lib/anastasis.c
+++ b/src/lib/anastasis.c
@@ -672,8 +672,11 @@ policy_lookup_cb (void *cls,
 
     for (int a = 0; a < r->ri->dps[j].nonces_length; a++)
     {
-      char buf[52];
-      strncpy (buf,nonces + a * 52,52);
+      char buf[53];
+
+      GNUNET_strlcpy (buf,
+                      nonces + a * 52,
+                      52);
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "At %s:%d buf is %s\n", __FILE__, __LINE__,
                   buf);
@@ -1705,7 +1708,9 @@ ANASTASIS_secret_share (struct GNUNET_CURL_Context *ctx,
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                   "nonce is:  %s\n",
                   nonce_str);
-      strncpy (nonces + b * strlen (nonce_str), nonce_str, strlen (nonce_str));
+      GNUNET_strlcpy (nonces + b * strlen (nonce_str),
+                      nonce_str,
+                      strlen (nonce_str));
     }
 
     nonces[52 * policies[k]->nonces_length] = '\0';

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

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