gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated (01439e25d -> d1bdcb261)


From: gnunet
Subject: [gnunet] branch master updated (01439e25d -> d1bdcb261)
Date: Tue, 03 Mar 2020 12:35:29 +0100

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

grothoff pushed a change to branch master
in repository gnunet.

    from 01439e25d do not segv if there is no postgres
     new 9a6588810 remove 'illegal' (non-reentrant) log logic from signal 
handler
     new d1bdcb261 make static analysis happier

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/util/configuration.c  |  3 ++-
 src/util/gnunet-timeout.c |  2 --
 src/util/strings.c        | 11 ++++++++---
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/util/configuration.c b/src/util/configuration.c
index 0480ebd5d..7ed87cc1e 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -1241,7 +1241,7 @@ GNUNET_CONFIGURATION_have_value (const struct 
GNUNET_CONFIGURATION_Handle *cfg,
  * @param cfg configuration to use for path expansion
  * @param orig string to $-expand (will be freed!)
  * @param depth recursion depth, used to detect recursive expansions
- * @return $-expanded string
+ * @return $-expanded string, never NULL unless @a orig was NULL
  */
 static char *
 expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -1421,6 +1421,7 @@ GNUNET_CONFIGURATION_expand_dollar (
       continue;
     dup = GNUNET_strdup (orig + i);
     dup = expand_dollar (cfg, dup, 0);
+    GNUNET_assert (NULL != dup); /* make compiler happy */
     len = strlen (dup) + 1;
     orig = GNUNET_realloc (orig, i + len);
     GNUNET_memcpy (orig + i, dup, len);
diff --git a/src/util/gnunet-timeout.c b/src/util/gnunet-timeout.c
index f650475cb..4c3c9125d 100644
--- a/src/util/gnunet-timeout.c
+++ b/src/util/gnunet-timeout.c
@@ -45,13 +45,11 @@ sigchld_handler (int val)
   if (WIFEXITED (status) != 0)
   {
     ret = WEXITSTATUS (status);
-    fprintf (stderr, "Process exited with result %u\n", ret);
     _exit (ret);  /* return same status code */
   }
   if (WIFSIGNALED (status) != 0)
   {
     ret = WTERMSIG (status);
-    fprintf (stderr, "Process received signal %u\n", ret);
     kill (getpid (), ret); /* kill self with the same signal */
   }
   _exit (-1);
diff --git a/src/util/strings.c b/src/util/strings.c
index a291dc4e1..f3089bf65 100644
--- a/src/util/strings.c
+++ b/src/util/strings.c
@@ -1932,6 +1932,7 @@ GNUNET_STRINGS_base64url_encode (const void *in, size_t 
len, char **output)
   return strlen (enc);
 }
 
+
 #define cvtfind(a)                        \
   ((((a) >= 'A') && ((a) <= 'Z'))         \
    ? (a) - 'A'                          \
@@ -1964,7 +1965,7 @@ GNUNET_STRINGS_base64_decode (const char *data, size_t 
len, void **out)
                 "ignoring CR/LF\n");                              \
     i++;                                                          \
     if (i >= len)                                                 \
-    goto END;                                                   \
+      goto END;                                                   \
   }
 
   output = GNUNET_malloc ((len * 3 / 4) + 8);
@@ -2046,16 +2047,20 @@ GNUNET_STRINGS_base64url_decode (const char *data, 
size_t len, void **out)
   case 0:
     break;   // No pad chars in this case
   case 2:
-    strncpy (&s[len], "==", 2);
+    memcpy (&s[len],
+            "==",
+            2);
+    len += 2;
     break;         // Two pad chars
   case 3:
     s[len] = '=';
+    len++;
     break;         // One pad char
   default:
     GNUNET_assert (0);
     break;
   }
-  ret = GNUNET_STRINGS_base64_decode (s, strlen (s), out);
+  ret = GNUNET_STRINGS_base64_decode (s, len, out);
   GNUNET_free (s);
   return ret;
 }

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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