diff options
Diffstat (limited to 'apps/plugin.c')
-rw-r--r-- | apps/plugin.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index 57bc09530a..b023a6553f 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -490,8 +490,6 @@ int plugin_load(const char* plugin, void* parameter) | |||
490 | gui_syncsplash(HZ*2, true, str(LANG_PLUGIN_CANT_OPEN), plugin); | 490 | gui_syncsplash(HZ*2, true, str(LANG_PLUGIN_CANT_OPEN), plugin); |
491 | return fd; | 491 | return fd; |
492 | } | 492 | } |
493 | /* zero out plugin buffer to ensure a properly zeroed bss area */ | ||
494 | memset(pluginbuf, 0, PLUGIN_BUFFER_SIZE); | ||
495 | 493 | ||
496 | readsize = read(fd, pluginbuf, PLUGIN_BUFFER_SIZE); | 494 | readsize = read(fd, pluginbuf, PLUGIN_BUFFER_SIZE); |
497 | close(fd); | 495 | close(fd); |
@@ -516,6 +514,9 @@ int plugin_load(const char* plugin, void* parameter) | |||
516 | return -1; | 514 | return -1; |
517 | } | 515 | } |
518 | plugin_size = hdr->end_addr - pluginbuf; | 516 | plugin_size = hdr->end_addr - pluginbuf; |
517 | |||
518 | /* zero out bss area only, above guards end of pluginbuf */ | ||
519 | memset(pluginbuf + readsize, 0, plugin_size - readsize); | ||
519 | #endif | 520 | #endif |
520 | 521 | ||
521 | plugin_loaded = true; | 522 | plugin_loaded = true; |