[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: internally assert that aspr
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: internally assert that asprintf size allocation never fails |
Date: |
Sat, 06 Jan 2018 21:22:26 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new 6532ac103 internally assert that asprintf size allocation never fails
6532ac103 is described below
commit 6532ac1037b448508642d4d97d21ab103bd6735c
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Jan 6 21:22:23 2018 +0100
internally assert that asprintf size allocation never fails
---
src/transport/plugin_transport_tcp.c | 7 ++++---
src/util/common_allocation.c | 1 +
src/util/configuration.c | 1 -
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/transport/plugin_transport_tcp.c
b/src/transport/plugin_transport_tcp.c
index c5d6e6d34..8b00543c3 100644
--- a/src/transport/plugin_transport_tcp.c
+++ b/src/transport/plugin_transport_tcp.c
@@ -3351,9 +3351,10 @@ handle_tcp_data (void *cls,
void *vaddr = NULL;
size_t alen;
- GNUNET_SERVER_client_get_address (client,
- &vaddr,
- &alen);
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_SERVER_client_get_address (client,
+ &vaddr,
+ &alen));
LOG (GNUNET_ERROR_TYPE_ERROR,
"Received unexpected %u bytes of type %u from `%s'\n",
(unsigned int) ntohs (message->size),
diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c
index be2538c3f..80047bb52 100644
--- a/src/util/common_allocation.c
+++ b/src/util/common_allocation.c
@@ -484,6 +484,7 @@ GNUNET_asprintf (char **buf,
va_start (args, format);
ret = VSNPRINTF (NULL, 0, format, args);
va_end (args);
+ GNUNET_assert (ret >= 0);
*buf = GNUNET_malloc (ret + 1);
va_start (args, format);
ret = VSPRINTF (*buf, format, args);
diff --git a/src/util/configuration.c b/src/util/configuration.c
index 7f1d98902..25eeaf80f 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -421,7 +421,6 @@ GNUNET_CONFIGURATION_serialize (const struct
GNUNET_CONFIGURATION_Handle *cfg,
size_t m_size;
size_t c_size;
-
/* Pass1 : calculate the buffer size required */
m_size = 0;
for (sec = cfg->sections; NULL != sec; sec = sec->next)
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: internally assert that asprintf size allocation never fails,
gnunet <=