msi: fixes from Mike McCormack

Aric Stewart aric at codeweavers.com
Tue Aug 16 07:49:42 CDT 2005


fixes a memory overflow and leak identified by Mike McCormack
-------------- next part --------------
Index: dlls/msi/action.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/action.c,v
retrieving revision 1.174
diff -u -r1.174 action.c
--- dlls/msi/action.c	15 Aug 2005 20:50:06 -0000	1.174
+++ dlls/msi/action.c	16 Aug 2005 12:48:33 -0000
@@ -3709,7 +3712,7 @@
                 INSTALLPROPERTY_DISKPROMPTW,NULL,&size);
         if (rc == ERROR_MORE_DATA)
         {
-            prompt = HeapAlloc(GetProcessHeap(),0,size);
+            prompt = HeapAlloc(GetProcessHeap(),0,size * sizeof(WCHAR));
             MsiSourceListGetInfoW(package->ProductCode, NULL, 
                     MSIINSTALLCONTEXT_USERMANAGED, MSICODE_PRODUCT,
                     INSTALLPROPERTY_DISKPROMPTW,prompt,&size);
@@ -3728,6 +3731,7 @@
             }
             attrib = GetFileAttributesW(package->PackagePath);
         }
+        HeapFree(GetProcessHeap(),0,prompt);
         rc = ERROR_SUCCESS;
     }
     else


More information about the wine-patches mailing list