summaryrefslogtreecommitdiff
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)
864 } 864 }
865 865
866 p_hdr = lc_get_header(current_plugin_handle); 866 p_hdr = lc_get_header(current_plugin_handle);
867
868 hdr = p_hdr ? &p_hdr->lc_hdr : NULL; 867 hdr = p_hdr ? &p_hdr->lc_hdr : NULL;
869 868
870
871 if (hdr == NULL 869 if (hdr == NULL
872 || hdr->magic != PLUGIN_MAGIC 870 || hdr->magic != PLUGIN_MAGIC
873 || hdr->target_id != TARGET_ID 871 || hdr->target_id != TARGET_ID
@@ -881,13 +879,15 @@ int plugin_load(const char* plugin, const void* parameter)
881 splash(HZ*2, ID2P(LANG_PLUGIN_WRONG_MODEL)); 879 splash(HZ*2, ID2P(LANG_PLUGIN_WRONG_MODEL));
882 return -1; 880 return -1;
883 } 881 }
884 if (hdr->api_version > PLUGIN_API_VERSION 882
885 || hdr->api_version < PLUGIN_MIN_API_VERSION) 883 if (hdr->api_version != PLUGIN_API_VERSION ||
884 p_hdr->api_size > sizeof(struct plugin_api))
886 { 885 {
887 lc_close(current_plugin_handle); 886 lc_close(current_plugin_handle);
888 splash(HZ*2, ID2P(LANG_PLUGIN_WRONG_VERSION)); 887 splash(HZ*2, ID2P(LANG_PLUGIN_WRONG_VERSION));
889 return -1; 888 return -1;
890 } 889 }
890
891#if (CONFIG_PLATFORM & PLATFORM_NATIVE) 891#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
892 /* tlsf crashes observed on arm with 0x4 aligned addresses */ 892 /* tlsf crashes observed on arm with 0x4 aligned addresses */
893 plugin_size = ALIGN_UP(hdr->end_addr - pluginbuf, 0x8); 893 plugin_size = ALIGN_UP(hdr->end_addr - pluginbuf, 0x8);