Peter Oberndorfer : dbghelp: Do not write to array element -1.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Nov 9 06:08:30 CST 2006


Module: wine
Branch: master
Commit: a39f3da5fcc9737d5af584749d78587df099a61c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a39f3da5fcc9737d5af584749d78587df099a61c

Author: Peter Oberndorfer <kumbayo84 at arcor.de>
Date:   Wed Nov  8 21:24:52 2006 +0100

dbghelp: Do not write to array element -1.

---

 dlls/dbghelp/elf_module.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c
index 8aaeb5f..86b5c7a 100644
--- a/dlls/dbghelp/elf_module.c
+++ b/dlls/dbghelp/elf_module.c
@@ -162,7 +162,7 @@ static const char* elf_map_section(struc
  */
 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);
         fmap->sect[sidx].mapped = NO_MAP;




More information about the wine-cvs mailing list