new Bug in OLE

Mike McCormack mikem at codeweavers.com
Thu Feb 28 18:39:03 CST 2002


ChangeLog:
* fix uninitialized variable in StgOpenStorage reported by Mehmet Yasar


> Mike McCormack wrote:
> > Hi Mehmet,
> > 
> > I created the problematic change in question.
> > 
> > Without the change, when StgOpenStorage is called with an existing
> > zero length file as the filename, it fails because it suceeded in
> > opening the file but expects it to have valid content...
> > 
> > Unfortunately, the change was merged incorrectly from the big CW
> > patch. (the Fad structure is not initiaized)
> > 
> > Could you try this patch instead please?
> > 
> > Mike
> 
> Thank you, the patch fixes the problem.
> 
> Mehmet
-------------- next part --------------
Index: dlls/ole32/storage32.c
===================================================================
RCS file: /home/wine/wine/dlls/ole32/storage32.c,v
retrieving revision 1.30
diff -u -r1.30 storage32.c
--- dlls/ole32/storage32.c	2002/02/08 17:09:11	1.30
+++ dlls/ole32/storage32.c	2002/02/27 22:14:02
@@ -5504,7 +5504,7 @@
   DWORD          shareMode;
   DWORD          accessMode;
   WCHAR          fullname[MAX_PATH];
-  WIN32_FILE_ATTRIBUTE_DATA Fad;
+  DWORD          length;
 
   TRACE("(%s, %p, %lx, %p, %ld, %p)\n", 
 	debugstr_w(pwcsName), pstgPriority, grfMode,
@@ -5547,6 +5547,7 @@
                        FILE_ATTRIBUTE_NORMAL | FILE_FLAG_RANDOM_ACCESS,
                        0);
   
+  length = GetFileSize(hFile, NULL);
   
   if (hFile==INVALID_HANDLE_VALUE)
   {
@@ -5599,7 +5600,7 @@
          NULL,
          grfMode,
          TRUE,
-	 !(Fad.nFileSizeHigh || Fad.nFileSizeLow) /* FALSE */ );
+	 !length );
   
   if (FAILED(hr))
   {


More information about the wine-patches mailing list