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

oldstable
Robert Shearman 2006-07-17 12:11:15 +01:00 committed by Alexandre Julliard
parent f9053b91bf
commit f57ddeb9db
1 changed files with 1 additions and 1 deletions

View File

@ -143,7 +143,7 @@ static const char* elf_map_section(struct elf_file_map* fmap, int sidx)
unsigned pgsz = getpagesize();
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)
return NO_MAP;
/* align required information on page size (we assume pagesize is a power of 2) */