gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated: -fix string termination


From: gnunet
Subject: [gnunet] branch master updated: -fix string termination
Date: Sat, 29 Oct 2022 16:12:28 +0200

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

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new daad78b8c -fix string termination
daad78b8c is described below

commit daad78b8cb65dd5ef1b5e38fe8b3e78f6fb322d9
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Sat Oct 29 23:12:21 2022 +0900

    -fix string termination
---
 src/identity/gnunet-identity.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/identity/gnunet-identity.c b/src/identity/gnunet-identity.c
index 6f09113d8..06e6fb613 100644
--- a/src/identity/gnunet-identity.c
+++ b/src/identity/gnunet-identity.c
@@ -263,7 +263,7 @@ write_encrypted_message (void)
       GNUNET_SYSERR)
   {
     struct GNUNET_CRYPTO_EcdhePublicKey message_key;
-    size_t msg_len = strlen (write_msg);
+    size_t msg_len = strlen (write_msg) + 1;
     ssize_t res = GNUNET_IDENTITY_encrypt (write_msg,
                                            msg_len,
                                            &recipient,
@@ -355,6 +355,7 @@ read_encrypted_message (struct GNUNET_IDENTITY_Ego *ego)
                                              deserialized_msg);
       if (-1 != res)
       {
+        deserialized_msg[res - 1] = '\0';
         fprintf (stdout,
                  "%s\n",
                  deserialized_msg);

-- 
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]