forked from len0rd/rockbox
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
This commit is contained in:
parent
4c151dcb21
commit
6c9a433ca1
1 changed files with 2 additions and 1 deletions
|
@ -577,7 +577,8 @@ int plugin_load(const char* plugin, void* parameter)
|
||||||
plugin_size = hdr->end_addr - pluginbuf;
|
plugin_size = hdr->end_addr - pluginbuf;
|
||||||
|
|
||||||
/* zero out bss area only, above guards end of 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
|
#endif
|
||||||
|
|
||||||
plugin_loaded = true;
|
plugin_loaded = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue