Module: wine Branch: master Commit: 35a0461baa03dea35df4f80afbd247173b284a02 URL: http://source.winehq.org/git/wine.git/?a=commit;h=35a0461baa03dea35df4f80afb...
Author: Hans Leidekker hans@codeweavers.com Date: Mon May 31 12:12:42 2010 +0200
msi: Improve parsing of patch summary information.
---
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) {