[3/4] msi: Improve parsing of patch summary information.

Hans Leidekker hans at codeweavers.com
Mon May 31 05:12:42 CDT 2010


---
 dlls/msi/action.c |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index 408c253..0505d33 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -496,6 +496,7 @@ UINT msi_parse_patch_summary( MSISUMMARYINFO *si, MSIPATCHINFO **patch )
 {
     MSIPATCHINFO *pi;
     UINT r = ERROR_SUCCESS;
+    WCHAR *p;
 
     pi = msi_alloc_zero( sizeof(MSIPATCHINFO) );
     if (!pi)
@@ -508,6 +509,30 @@ UINT msi_parse_patch_summary( MSISUMMARYINFO *si, MSIPATCHINFO **patch )
         return ERROR_OUTOFMEMORY;
     }
 
+    p = pi->patchcode;
+    if (*p != '{')
+    {
+        msi_free( pi->patchcode );
+        msi_free( pi );
+        return ERROR_PATCH_PACKAGE_INVALID;
+    }
+
+    p = strchrW( p + 1, '}' );
+    if (!p)
+    {
+        msi_free( pi->patchcode );
+        msi_free( pi );
+        return ERROR_PATCH_PACKAGE_INVALID;
+    }
+
+    if (p[1])
+    {
+        FIXME("patch obsoletes %s\n", debugstr_w(p + 1));
+        p[1] = 0;
+    }
+
+    TRACE("patch code %s\n", debugstr_w(pi->patchcode));
+
     pi->transforms = msi_suminfo_dup_string( si, PID_LASTAUTHOR );
     if (!pi->transforms)
     {
-- 
1.7.0.4







More information about the wine-patches mailing list