Commit f57ddeb9 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

dbghelp: Don't access a negative section index in elf_map_section.

parent f9053b91
...@@ -143,7 +143,7 @@ static const char* elf_map_section(struct elf_file_map* fmap, int sidx) ...@@ -143,7 +143,7 @@ static const char* elf_map_section(struct elf_file_map* fmap, int sidx)
unsigned pgsz = getpagesize(); unsigned pgsz = getpagesize();
unsigned ofst, size; unsigned ofst, size;
if (sidx >= fmap->elfhdr.e_shnum || if (sidx < 0 || sidx >= fmap->elfhdr.e_shnum ||
fmap->sect[sidx].shdr.sh_type == SHT_NOBITS) fmap->sect[sidx].shdr.sh_type == SHT_NOBITS)
return NO_MAP; return NO_MAP;
/* align required information on page size (we assume pagesize is a power of 2) */ /* align required information on page size (we assume pagesize is a power of 2) */
......
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