Commit a39f3da5 authored by Peter Oberndorfer's avatar Peter Oberndorfer Committed by Alexandre Julliard

dbghelp: Do not write to array element -1.

parent fa8fc162
...@@ -162,7 +162,7 @@ static const char* elf_map_section(struct elf_file_map* fmap, int sidx) ...@@ -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) 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); munmap((char*)fmap->sect[sidx].mapped, fmap->sect[sidx].shdr.sh_size);
fmap->sect[sidx].mapped = NO_MAP; fmap->sect[sidx].mapped = NO_MAP;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment