dbghelp: Initialize the elf_section_map in case of failures in elf_find_section.
Make sidx signed so sidx < 0 comparisons work. (most of the patch written by Eric Pouech)
This commit is contained in:
parent
4c73411047
commit
7bbb212050
|
@ -119,7 +119,7 @@ struct elf_file_map
|
||||||
struct elf_section_map
|
struct elf_section_map
|
||||||
{
|
{
|
||||||
struct elf_file_map* fmap;
|
struct elf_file_map* fmap;
|
||||||
unsigned sidx;
|
long sidx;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct symtab_elt
|
struct symtab_elt
|
||||||
|
@ -178,8 +178,7 @@ static BOOL elf_find_section(struct elf_file_map* fmap, const char* name,
|
||||||
if (fmap->shstrtab == ELF_NO_MAP)
|
if (fmap->shstrtab == ELF_NO_MAP)
|
||||||
{
|
{
|
||||||
struct elf_section_map hdr_esm = {fmap, fmap->elfhdr.e_shstrndx};
|
struct elf_section_map hdr_esm = {fmap, fmap->elfhdr.e_shstrndx};
|
||||||
fmap->shstrtab = elf_map_section(&hdr_esm);
|
if ((fmap->shstrtab = elf_map_section(&hdr_esm)) == ELF_NO_MAP) break;
|
||||||
if (fmap->shstrtab == ELF_NO_MAP) return FALSE;
|
|
||||||
}
|
}
|
||||||
for (i = 0; i < fmap->elfhdr.e_shnum; i++)
|
for (i = 0; i < fmap->elfhdr.e_shnum; i++)
|
||||||
{
|
{
|
||||||
|
@ -193,6 +192,8 @@ static BOOL elf_find_section(struct elf_file_map* fmap, const char* name,
|
||||||
}
|
}
|
||||||
fmap = fmap->alternate;
|
fmap = fmap->alternate;
|
||||||
}
|
}
|
||||||
|
esm->fmap = NULL;
|
||||||
|
esm->sidx = -1;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue