From 7bbb21205005f9b14ca7f58a126b512cb8941420 Mon Sep 17 00:00:00 2001 From: Peter Oberndorfer Date: Thu, 15 Mar 2007 21:57:04 +0100 Subject: [PATCH] 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) --- dlls/dbghelp/elf_module.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c index 62a1ee86db1..b1b6b747789 100644 --- a/dlls/dbghelp/elf_module.c +++ b/dlls/dbghelp/elf_module.c @@ -119,7 +119,7 @@ struct elf_file_map struct elf_section_map { struct elf_file_map* fmap; - unsigned sidx; + long sidx; }; 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) { struct elf_section_map hdr_esm = {fmap, fmap->elfhdr.e_shstrndx}; - fmap->shstrtab = elf_map_section(&hdr_esm); - if (fmap->shstrtab == ELF_NO_MAP) return FALSE; + if ((fmap->shstrtab = elf_map_section(&hdr_esm)) == ELF_NO_MAP) break; } 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; } + esm->fmap = NULL; + esm->sidx = -1; return FALSE; }