wine/debugger/stabs.c patch breaks FreeBSD

Eric Pouech eric.pouech at wanadoo.fr
Tue Apr 2 13:30:21 CST 2002


Gerald Pfeifer a écrit :
> 
> The following patch to wine/debugger/stabs.c breaks FreeBSD:
> 
>   revision 1.45
>   date: 2002/04/02 02:38:37;  author: julliard;  state: Exp;  lines: +2 -0
>   Check ELF signature before processing file.
that should fix it in a portable manner

Index: debugger/stabs.c
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/debugger/stabs.c,v
retrieving revision 1.45
diff -u -r1.45 stabs.c
--- debugger/stabs.c    2 Apr 2002 02:38:37 -0000       1.45
+++ debugger/stabs.c    2 Apr 2002 19:29:41 -0000
@@ -1229,7 +1229,10 @@
      * table.
      */
     ehptr = (Elf32_Ehdr*) addr;
-    if (memcmp( ehptr->e_ident, ELFMAG, SELFMAG )) goto leave;
+    if (ehptr->e_ident[0] != ELFMAG0 ||
+        ehptr->e_ident[1] != ELFMAG1 ||
+        ehptr->e_ident[2] != ELFMAG2 ||
+        ehptr->e_ident[3] != ELFMAG3) goto leave;

     spnt = (Elf32_Shdr*) (addr + ehptr->e_shoff);
     shstrtab = (addr + spnt[ehptr->e_shstrndx].sh_offset);



More information about the wine-devel mailing list