dbghelp: Do not write to array element -1.

This commit is contained in:
Peter Oberndorfer 2006-11-08 21:24:52 +01:00 committed by Alexandre Julliard
parent fa8fc1628a
commit a39f3da5fc
1 changed files with 1 additions and 1 deletions

View File

@ -162,7 +162,7 @@ static const char* elf_map_section(struct elf_file_map* fmap, int sidx)
*/
static void elf_unmap_section(struct elf_file_map* fmap, int sidx)
{
if (sidx < fmap->elfhdr.e_shnum && fmap->sect[sidx].mapped != NO_MAP)
if (sidx >= 0 && sidx < fmap->elfhdr.e_shnum && fmap->sect[sidx].mapped != NO_MAP)
{
munmap((char*)fmap->sect[sidx].mapped, fmap->sect[sidx].shdr.sh_size);
fmap->sect[sidx].mapped = NO_MAP;