From 27181dcea23a0719f607b0ccba107e7e2aac259e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Mal=C3=BD?= Date: Sun, 27 Jul 2014 10:38:06 +0200 Subject: [PATCH] Do not post events to invalid plugins --- klgd.c | 3 +++ 1 file changed, 3 insertions(+) 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) { -- 2.43.5