Traces and Valgrind

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Changelog:


 * dlls/advapi32/registry.c,
   dlls/ntdll/resource.c

Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
Try not to display uninitialized data in traces (found by Valgrind):
In RegQueryValueExW, if the data pointer is NULL, then *count is irrelevant and may actually not have been initialized by the caller.
In LdrFindResourceDirectory_U and LdrFindResource_U, if level <= 2, then info->Language is irrelevant and may not have been initialized by the caller.


--
Francois Gouget
fgouget@xxxxxxxxxxxxxxx

Index: dlls/advapi32/registry.c
===================================================================
RCS file: /home/cvs/wine/dlls/advapi32/registry.c,v
retrieving revision 1.57
diff -u -r1.57 registry.c
--- dlls/advapi32/registry.c	17 Nov 2003 20:31:30 -0000	1.57
+++ dlls/advapi32/registry.c	19 Nov 2003 21:31:49 -0000
@@ -1013,7 +1013,8 @@
     static const int info_size = offsetof( KEY_VALUE_PARTIAL_INFORMATION, Data );
 
     TRACE("(%p,%s,%p,%p,%p,%p=%ld)\n",
-          hkey, debugstr_w(name), reserved, type, data, count, count ? *count : 0 );
+          hkey, debugstr_w(name), reserved, type, data, count,
+          (count && data) ? *count : 0 );
 
     if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER;
     if (!(hkey = get_special_root_hkey( hkey ))) return ERROR_INVALID_HANDLE;
Index: dlls/ntdll/resource.c
===================================================================
RCS file: /home/cvs/wine/dlls/ntdll/resource.c,v
retrieving revision 1.5
diff -u -r1.5 resource.c
--- dlls/ntdll/resource.c	5 Sep 2003 23:08:34 -0000	1.5
+++ dlls/ntdll/resource.c	19 Nov 2003 21:31:49 -0000
@@ -274,7 +274,8 @@
 
     if (info) TRACE( "module %p type %s name %s lang %04lx level %ld\n",
                      hmod, debugstr_w((LPCWSTR)info->Type),
-                     debugstr_w((LPCWSTR)info->Name), info->Language, level );
+                     debugstr_w((LPCWSTR)info->Name),
+                     (level > 2 ? info->Language : 0), level );
 
     __TRY
     {
@@ -301,7 +302,8 @@
 
     if (info) TRACE( "module %p type %s name %s lang %04lx level %ld\n",
                      hmod, debugstr_w((LPCWSTR)info->Type),
-                     debugstr_w((LPCWSTR)info->Name), info->Language, level );
+                     debugstr_w((LPCWSTR)info->Name), info->Language,
+                     (level > 2 ? info->Language : 0), level );
 
     __TRY
     {

[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux