diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2007-04-12 05:18:53 +0000 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2007-04-12 05:18:53 +0000 |
| commit | 6c9a433ca15f40f268fe26515c9ba1629dc00c3d (patch) | |
| tree | b8fb9c767286b06783922ab7270a713a6d8da11b /apps/plugin.c | |
| parent | 4c151dcb2199caafe0c1fd4d88ab66b6acdf6bd6 (diff) | |
| download | rockbox-6c9a433ca15f40f268fe26515c9ba1629dc00c3d.zip rockbox-6c9a433ca15f40f268fe26515c9ba1629dc00c3d.tar.gz rockbox-6c9a433ca15f40f268fe26515c9ba1629dc00c3d.tar.bz2 rockbox-6c9a433ca15f40f268fe26515c9ba1629dc00c3d.tar.xz | |
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/plugin.c')
| -rw-r--r-- | apps/plugin.c | 3 |
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; |