From e15ee8365a5eb40aaf2448c4f649af30297d6817 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 25 Jun 2017 00:42:25 +0200 Subject: fix crash if block plugin not found --- src/block/block.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/block/block.c b/src/block/block.c index 4b6f3826d..bbf45477c 100644 --- a/src/block/block.c +++ b/src/block/block.c @@ -151,10 +151,9 @@ GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg) void GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx) { - unsigned int i; struct Plugin *plugin; - for (i = 0; i < ctx->num_plugins; i++) + for (unsigned int i = 0; i < ctx->num_plugins; i++) { plugin = ctx->plugins[i]; GNUNET_break (NULL == @@ -301,6 +300,8 @@ GNUNET_BLOCK_group_create (struct GNUNET_BLOCK_Context *ctx, plugin = find_plugin (ctx, type); + if (NULL == plugin) + return NULL; if (NULL == plugin->create_group) return NULL; va_start (ap, -- cgit v1.2.3