summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-06-16 01:57:30 +0200
committerChristian Grothoff <christian@grothoff.org>2019-06-16 01:57:30 +0200
commit9e2e2a7759dad741f060adaf1c11e0fc17f7310b (patch)
tree63577a75bf0bbdfb86a2739eaa3255815e1eeccc
parentad58257c5b5fc728faee55aaaea3ce747447a28a (diff)
downloadtwister-9e2e2a7759dad741f060adaf1c11e0fc17f7310b.tar.gz
twister-9e2e2a7759dad741f060adaf1c11e0fc17f7310b.tar.bz2
twister-9e2e2a7759dad741f060adaf1c11e0fc17f7310b.zip
do not assert on bad config, also check return value
-rw-r--r--src/twister/taler-twister-service.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/twister/taler-twister-service.c b/src/twister/taler-twister-service.c
index e14959d..918dd5d 100644
--- a/src/twister/taler-twister-service.c
+++ b/src/twister/taler-twister-service.c
@@ -1843,7 +1843,7 @@ create_response (void *cls,
flip_path_dl))
{
GNUNET_free (flip_path_dl);
- flip_path_dl = NULL;
+ flip_path_dl = NULL;
}
}
@@ -2446,11 +2446,21 @@ run (void *cls,
/* No need to check return value. If given, we take,
* otherwise it stays zero. */
- GNUNET_CONFIGURATION_get_value_number (c,
- "twister",
- "CHAOS_RATE",
- &chaos_rate);
- GNUNET_assert (100 >= chaos_rate);
+ if (GNUNET_OK !=
+ GNUNET_CONFIGURATION_get_value_number (c,
+ "twister",
+ "CHAOS_RATE",
+ &chaos_rate))
+ chaos_rate = 0;
+ if (100 < chaos_rate)
+ {
+ GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR,
+ "twister",
+ "CHAOS_RATE",
+ "must be below 100");
+ GNUNET_SCHEDULER_shutdown ();
+ return;
+ }
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string