From: Michal MalĂ˝ Date: Sun, 27 Jul 2014 08:38:06 +0000 (+0200) Subject: Do not post events to invalid plugins X-Git-Url: https://gitweb.devoid-pointer.net/?a=commitdiff_plain;h=27181dcea23a0719f607b0ccba107e7e2aac259e;p=KLGD.git Do not post events to invalid plugins --- diff --git a/klgd.c b/klgd.c index d9cfe82..eea23a4 100644 --- a/klgd.c +++ b/klgd.c @@ -194,6 +194,9 @@ int klgd_post_event(struct klgd_main *ctx, size_t idx, void *data) struct klgd_plugin *plugin = ctx->private->plugins[idx]; int ret; + if (!plugin || idx >= ctx->private->plugin_count) + return -EINVAL; + mutex_lock(&ctx->private->stream_mlock); ret = plugin->post_event(plugin, data); if (ret) {