msi: fix a crash in MsiGetComponentPathA

Aric Stewart aric at codeweavers.com
Mon Jun 6 14:50:55 CDT 2005


correct a crash if the length buffer is NULL

-------------- next part --------------
Index: dlls/msi/msi.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/msi.c,v
retrieving revision 1.85
diff -u -r1.85 msi.c
--- dlls/msi/msi.c	3 Jun 2005 11:24:57 -0000	1.85
+++ dlls/msi/msi.c	6 Jun 2005 19:50:58 -0000
@@ -971,11 +971,16 @@
     }
 
     if( pcchBuf && *pcchBuf > 0 )
+    {
         lpwPathBuf = HeapAlloc( GetProcessHeap(), 0, *pcchBuf * sizeof(WCHAR));
+        incoming_len = *pcchBuf;
+    }
     else
+    {
         lpwPathBuf = NULL;
+        incoming_len = 0;
+    }
 
-    incoming_len = *pcchBuf;
     rc = MsiGetComponentPathW(szwProduct, szwComponent, lpwPathBuf, pcchBuf);
 
     HeapFree( GetProcessHeap(), 0, szwProduct);


More information about the wine-patches mailing list