summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-04-12 05:18:53 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-04-12 05:18:53 +0000
commit6c9a433ca15f40f268fe26515c9ba1629dc00c3d (patch)
treeb8fb9c767286b06783922ab7270a713a6d8da11b /apps
parent4c151dcb2199caafe0c1fd4d88ab66b6acdf6bd6 (diff)
downloadrockbox-6c9a433ca15f40f268fe26515c9ba1629dc00c3d.tar.gz
rockbox-6c9a433ca15f40f268fe26515c9ba1629dc00c3d.zip
Add a check to make sure initializing the BSS section doesn't pass a negative size to memset.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13116 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugin.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index 276bf1b078..1db0253c4e 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;