[1/2] msi: Don't crash if no working directory is specified for custom action type 34.
Hans Leidekker
hans at codeweavers.com
Mon Jul 9 04:08:06 CDT 2012
Fixes http://bugs.winehq.org/show_bug.cgi?id=31165
---
dlls/msi/custom.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/dlls/msi/custom.c b/dlls/msi/custom.c
index c1aa627..88dcf87 100644
--- a/dlls/msi/custom.c
+++ b/dlls/msi/custom.c
@@ -935,13 +935,15 @@ static UINT HANDLE_CustomType50(MSIPACKAGE *package, LPCWSTR source,
static UINT HANDLE_CustomType34(MSIPACKAGE *package, LPCWSTR source,
LPCWSTR target, const INT type, LPCWSTR action)
{
- const WCHAR *workingdir;
+ const WCHAR *workingdir = NULL;
HANDLE handle;
WCHAR *cmd;
- workingdir = msi_get_target_folder( package, source );
- if (!workingdir) return ERROR_FUNCTION_FAILED;
-
+ if (source)
+ {
+ workingdir = msi_get_target_folder( package, source );
+ if (!workingdir) return ERROR_FUNCTION_FAILED;
+ }
deformat_string( package, target, &cmd );
if (!cmd) return ERROR_FUNCTION_FAILED;
--
1.7.10.4
More information about the wine-patches
mailing list