Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
dbb5d2a8
Commit
dbb5d2a8
authored
Jan 14, 2005
by
Aric Stewart
Committed by
Alexandre Julliard
Jan 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Custom actions can have null in their target parameters, handle that
without crashing. Also enable deformating of lines greater than 256 characters.
parent
a84e7d7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
14 deletions
+36
-14
action.c
dlls/msi/action.c
+36
-14
No files found.
dlls/msi/action.c
View file @
dbb5d2a8
...
...
@@ -1527,15 +1527,21 @@ static UINT HANDLE_CustomType2(MSIPACKAGE *package, const LPWSTR source,
deformat_string
(
package
,
target
,
&
deformated
);
len
=
strlenW
(
tmp_file
)
+
strlenW
(
deformated
)
+
2
;
len
=
strlenW
(
tmp_file
)
+
2
;
if
(
deformated
)
len
+=
strlenW
(
deformated
);
cmd
=
(
WCHAR
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
len
);
strcpyW
(
cmd
,
tmp_file
);
strcatW
(
cmd
,
spc
);
strcatW
(
cmd
,
deformated
);
if
(
deformated
)
{
strcatW
(
cmd
,
spc
);
strcatW
(
cmd
,
deformated
);
HeapFree
(
GetProcessHeap
(),
0
,
deformated
);
HeapFree
(
GetProcessHeap
(),
0
,
deformated
);
}
TRACE
(
"executing exe %s
\n
"
,
debugstr_w
(
cmd
));
...
...
@@ -1577,16 +1583,20 @@ static UINT HANDLE_CustomType18(MSIPACKAGE *package, const LPWSTR source,
len
=
strlenW
(
package
->
files
[
index
].
TargetPath
);
deformat_string
(
package
,
target
,
&
deformated
);
len
+=
strlenW
(
deformated
);
if
(
deformated
)
len
+=
strlenW
(
deformated
);
len
+=
2
;
cmd
=
(
WCHAR
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
strcpyW
(
cmd
,
package
->
files
[
index
].
TargetPath
);
strcatW
(
cmd
,
spc
);
strcatW
(
cmd
,
deformated
);
if
(
deformated
)
{
strcatW
(
cmd
,
spc
);
strcatW
(
cmd
,
deformated
);
HeapFree
(
GetProcessHeap
(),
0
,
deformated
);
HeapFree
(
GetProcessHeap
(),
0
,
deformated
);
}
TRACE
(
"executing exe %s
\n
"
,
debugstr_w
(
cmd
));
...
...
@@ -1630,14 +1640,20 @@ static UINT HANDLE_CustomType50(MSIPACKAGE *package, const LPWSTR source,
return
prc
;
deformat_string
(
package
,
target
,
&
deformated
);
len
=
strlenW
(
prop
)
+
strlenW
(
deformated
)
+
2
;
len
=
strlenW
(
prop
)
+
2
;
if
(
deformated
)
len
+=
strlenW
(
deformated
);
cmd
=
(
WCHAR
*
)
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
WCHAR
)
*
len
);
strcpyW
(
cmd
,
prop
);
strcatW
(
cmd
,
spc
);
strcatW
(
cmd
,
deformated
);
if
(
deformated
)
{
strcatW
(
cmd
,
spc
);
strcatW
(
cmd
,
deformated
);
HeapFree
(
GetProcessHeap
(),
0
,
deformated
);
HeapFree
(
GetProcessHeap
(),
0
,
deformated
);
}
TRACE
(
"executing exe %s
\n
"
,
debugstr_w
(
cmd
));
...
...
@@ -1680,6 +1696,9 @@ static UINT HANDLE_CustomType34(MSIPACKAGE *package, const LPWSTR source,
deformat_string
(
package
,
target
,
&
deformated
);
if
(
!
deformated
)
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"executing exe %s
\n
"
,
debugstr_w
(
deformated
));
rc
=
CreateProcessW
(
NULL
,
deformated
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
...
...
@@ -3666,6 +3685,7 @@ next:
static
DWORD
deformat_string
(
MSIPACKAGE
*
package
,
WCHAR
*
ptr
,
WCHAR
**
data
)
{
WCHAR
*
mark
=
NULL
;
WCHAR
*
mark2
;
DWORD
size
=
0
;
DWORD
chunk
=
0
;
WCHAR
key
[
0x100
];
...
...
@@ -3679,6 +3699,7 @@ static DWORD deformat_string(MSIPACKAGE *package, WCHAR* ptr,WCHAR** data)
*
data
=
NULL
;
return
0
;
}
TRACE
(
"Starting with %s
\n
"
,
debugstr_w
(
ptr
));
/* scan for special characters */
if
(
!
strchrW
(
ptr
,
'['
)
||
(
strchrW
(
ptr
,
'['
)
&&
!
strchrW
(
ptr
,
']'
)))
{
...
...
@@ -3708,8 +3729,9 @@ static DWORD deformat_string(MSIPACKAGE *package, WCHAR* ptr,WCHAR** data)
(
*
data
)[
0
]
=
0
;
}
mark
++
;
strcpyW
(
key
,
mark
);
*
strchrW
(
key
,
']'
)
=
0
;
mark2
=
strchrW
(
mark
,
']'
);
strncpyW
(
key
,
mark
,
mark2
-
mark
);
key
[
mark2
-
mark
]
=
0
;
mark
=
strchrW
(
mark
,
']'
);
mark
++
;
TRACE
(
"Current %s .. %s
\n
"
,
debugstr_w
(
*
data
),
debugstr_w
(
mark
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment