summaryrefslogtreecommitdiff
path: root/apps/plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugin.c')
-rw-r--r--apps/plugin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 276bf1b..1db0253 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -577,7 +577,8 @@ int plugin_load(const char* plugin, void* parameter)
plugin_size = hdr->end_addr - pluginbuf;
/* zero out bss area only, above guards end of pluginbuf */
- memset(pluginbuf + readsize, 0, plugin_size - readsize);
+ if (plugin_size > readsize)
+ memset(pluginbuf + readsize, 0, plugin_size - readsize);
#endif
plugin_loaded = true;