From: Christian Grothoff Date: Sat, 24 Jun 2017 22:42:25 +0000 (+0200) Subject: fix crash if block plugin not found X-Git-Tag: gnunet-0.11.0rc0~214 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e15ee8365a5eb40aaf2448c4f649af30297d6817;p=oweals%2Fgnunet.git fix crash if block plugin not found --- 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,