this patch fixes a couple of bugs in dbghelp
A+
--
Eric Pouech
Name:          dbghelp19
ChangeLog:     
	- PDB: better checking for error conditions
	- Fixed name demangling (when activated) when searching for a symbol

License:       X11
GenDate:       2005/03/28 16:17:32 UTC
ModifiedFiles: dlls/dbghelp/msc.c dlls/dbghelp/symbol.c
AddedFiles:    
RemovedFiles:  
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/dbghelp/msc.c,v
retrieving revision 1.12
diff -u -u -r1.12 msc.c
--- dlls/dbghelp/msc.c	15 Mar 2005 19:32:14 -0000	1.12
+++ dlls/dbghelp/msc.c	18 Mar 2005 19:58:05 -0000
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 1996,      Eric Youngdale.
  * Copyright (C) 1999-2000, Ulrich Weigand.
- * Copyright (C) 2004,      Eric Pouech.
+ * Copyright (C) 2004-2005, Eric Pouech.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -496,11 +496,10 @@
 {
     struct symt_udt*            symt;
     const unsigned char*        ptr = list;
-    int                         value, leaf_len, vpoff, vplen;
+    int                         value, leaf_len;
     const struct p_string*      p_name;
     const char*                 c_name;
     struct symt*                subtype;
-    const unsigned short int* p_vboff;
 
     symt = symt_new_udt(module, NULL, 0, UdtStruct /* don't care */);
     while (ptr - list < len)
@@ -534,6 +533,8 @@
         case LF_VBCLASS_V1:
         case LF_IVBCLASS_V1:
             {
+                const unsigned short int* p_vboff;
+                int vpoff, vplen;
                 leaf_len = numeric_leaf(&value, &type->vbclass_v1.vbpoff);
                 p_vboff = (const unsigned short int*)((const char*)&type->vbclass_v1.vbpoff + leaf_len);
                 vplen = numeric_leaf(&vpoff, p_vboff);
@@ -547,6 +548,8 @@
         case LF_VBCLASS_V2:
         case LF_IVBCLASS_V2:
             {
+                const unsigned short int* p_vboff;
+                int vpoff, vplen;
                 leaf_len = numeric_leaf(&value, &type->vbclass_v2.vbpoff);
                 p_vboff = (const unsigned short int*)((const char*)&type->vbclass_v2.vbpoff + leaf_len);
                 vplen = numeric_leaf(&vpoff, p_vboff);
@@ -1156,7 +1159,8 @@
     {
         const union codeview_symbol* sym = (const union codeview_symbol*)(root + i);
         length = sym->generic.len + 2;
-        if (length & 3) FIXME("unpadded len %u\n", length + 2);
+        if (i + length > size) break;
+        if (length & 3) FIXME("unpadded len %u\n", length);
 
         switch (sym->generic.id)
         {
Index: dlls/dbghelp/symbol.c
===================================================================
RCS file: /home/cvs/cvsroot/wine/wine/dlls/dbghelp/symbol.c,v
retrieving revision 1.16
diff -u -u -r1.16 symbol.c
--- dlls/dbghelp/symbol.c	28 Mar 2005 14:17:52 -0000	1.16
+++ dlls/dbghelp/symbol.c	28 Mar 2005 14:36:40 -0000
@@ -532,7 +532,7 @@
     if (sym_info->MaxNameLen)
     {
         if (sym->tag != SymTagPublicSymbol || !(dbghelp_options & SYMOPT_UNDNAME) ||
-            (sym_info->NameLen = UnDecorateSymbolName(sym_info->Name, sym_info->Name, 
+            (sym_info->NameLen = UnDecorateSymbolName(name, sym_info->Name, 
                                                       sym_info->MaxNameLen, UNDNAME_COMPLETE) == 0))
         {
             sym_info->NameLen = min(strlen(name), sym_info->MaxNameLen - 1);

Reply via email to