msiexec null reference

Bill Medland billmedland at mercuryspeed.com
Mon Dec 19 18:16:13 CST 2005


Bill Medland (billmedland at mercuryspeed.com)
Prevent dereferencing null pointer in msiexec

Index: wine/dlls/msi/dialog.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/dialog.c,v
retrieving revision 1.61
diff -u -r1.61 dialog.c
--- wine/dlls/msi/dialog.c 28 Nov 2005 10:59:14 -0000 1.61
+++ wine/dlls/msi/dialog.c 20 Dec 2005 00:06:41 -0000
@@ -1618,6 +1618,8 @@
 {
     static const WCHAR df[] = {
         'D','e','f','a','u','l','t','U','I','F','o','n','t',0 };
+    static const WCHAR dfv[] = {
+        'M','S',' ','S','h','e','l','l',' ','D','l','g',0 };
     msi_dialog *dialog = (msi_dialog*) cs->lpCreateParams;
     MSIRECORD *rec = NULL;
     LPWSTR title = NULL;
@@ -1644,6 +1646,13 @@
     dialog->attributes = MSI_RecordGetInteger( rec, 6 );
 
     dialog->default_font = msi_dup_property( dialog->package, df );
+    if (!dialog->default_font)
+    {
+        DWORD len = strlenW (dfv) + 1;
+        dialog->default_font = msi_alloc(len*sizeof(WCHAR));
+        if (!dialog->default_font) return -1;
+        memcpy (dialog->default_font, dfv, len*sizeof(WCHAR));
+    }
 
     title = msi_get_deformatted_field( dialog->package, rec, 7 );
     SetWindowTextW( hwnd, title );



More information about the wine-patches mailing list