diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-01-06 21:22:23 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-01-06 21:22:23 +0100 |
commit | 6532ac1037b448508642d4d97d21ab103bd6735c (patch) | |
tree | e341bfbc88da6cd1ca8f7c528164411082f1f49f /src/util | |
parent | 8dea30580ceaa571c9d85b5e8a563201ed622ed7 (diff) | |
download | gnunet-6532ac1037b448508642d4d97d21ab103bd6735c.tar.gz gnunet-6532ac1037b448508642d4d97d21ab103bd6735c.zip |
internally assert that asprintf size allocation never fails
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/common_allocation.c | 1 | ||||
-rw-r--r-- | src/util/configuration.c | 1 |
2 files changed, 1 insertions, 1 deletions
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, | |||
484 | va_start (args, format); | 484 | va_start (args, format); |
485 | ret = VSNPRINTF (NULL, 0, format, args); | 485 | ret = VSNPRINTF (NULL, 0, format, args); |
486 | va_end (args); | 486 | va_end (args); |
487 | GNUNET_assert (ret >= 0); | ||
487 | *buf = GNUNET_malloc (ret + 1); | 488 | *buf = GNUNET_malloc (ret + 1); |
488 | va_start (args, format); | 489 | va_start (args, format); |
489 | ret = VSPRINTF (*buf, format, args); | 490 | 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, | |||
421 | size_t m_size; | 421 | size_t m_size; |
422 | size_t c_size; | 422 | size_t c_size; |
423 | 423 | ||
424 | |||
425 | /* Pass1 : calculate the buffer size required */ | 424 | /* Pass1 : calculate the buffer size required */ |
426 | m_size = 0; | 425 | m_size = 0; |
427 | for (sec = cfg->sections; NULL != sec; sec = sec->next) | 426 | for (sec = cfg->sections; NULL != sec; sec = sec->next) |