summaryrefslogtreecommitdiffstats
path: root/apps/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugin.c')
-rw-r--r--apps/plugin.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index cdbe340ddd..1a0aedf3cc 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -864,10 +864,8 @@ int plugin_load(const char* plugin, const void* parameter)
}
p_hdr = lc_get_header(current_plugin_handle);
-
hdr = p_hdr ? &p_hdr->lc_hdr : NULL;
-
if (hdr == NULL
|| hdr->magic != PLUGIN_MAGIC
|| hdr->target_id != TARGET_ID
@@ -881,13 +879,15 @@ int plugin_load(const char* plugin, const void* parameter)
splash(HZ*2, ID2P(LANG_PLUGIN_WRONG_MODEL));
return -1;
}
- if (hdr->api_version > PLUGIN_API_VERSION
- || hdr->api_version < PLUGIN_MIN_API_VERSION)
+
+ if (hdr->api_version != PLUGIN_API_VERSION ||
+ p_hdr->api_size > sizeof(struct plugin_api))
{
lc_close(current_plugin_handle);
splash(HZ*2, ID2P(LANG_PLUGIN_WRONG_VERSION));
return -1;
}
+
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
/* tlsf crashes observed on arm with 0x4 aligned addresses */
plugin_size = ALIGN_UP(hdr->end_addr - pluginbuf, 0x8);