Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
943ead50
Commit
943ead50
authored
Jul 15, 2015
by
Piotr Caban
Committed by
Alexandre Julliard
Jul 16, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Fix SHELL_execute code that removes quote arround file name.
parent
663f9f4b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
shlexec.c
dlls/shell32/shlexec.c
+5
-6
shlexec.c
dlls/shell32/tests/shlexec.c
+11
-0
No files found.
dlls/shell32/shlexec.c
View file @
943ead50
...
...
@@ -1592,14 +1592,13 @@ static BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
wszApplicationName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwApplicationNameLen
*
sizeof
(
WCHAR
));
*
wszApplicationName
=
'\0'
;
}
else
if
(
*
sei_tmp
.
lpFile
==
'\"'
)
else
if
(
*
sei_tmp
.
lpFile
==
'\"'
&&
sei_tmp
.
lpFile
[(
len
=
strlenW
(
sei_tmp
.
lpFile
))
-
1
]
==
'\"'
)
{
DWORD
l
=
strlenW
(
sei_tmp
.
lpFile
+
1
);
if
(
l
>=
dwApplicationNameLen
)
dwApplicationNameLen
=
l
+
1
;
if
(
len
-
1
>=
dwApplicationNameLen
)
dwApplicationNameLen
=
len
;
wszApplicationName
=
HeapAlloc
(
GetProcessHeap
(),
0
,
dwApplicationNameLen
*
sizeof
(
WCHAR
));
memcpy
(
wszApplicationName
,
sei_tmp
.
lpFile
+
1
,
(
l
+
1
)
*
sizeof
(
WCHAR
));
if
(
wszApplicationName
[
l
-
1
]
==
'\"'
)
wszApplicationName
[
l
-
1
]
=
'\0'
;
memcpy
(
wszApplicationName
,
sei_tmp
.
lpFile
+
1
,
len
*
sizeof
(
WCHAR
));
if
(
len
>
2
)
wszApplicationName
[
l
en
-
2
]
=
'\0'
;
TRACE
(
"wszApplicationName=%s
\n
"
,
debugstr_w
(
wszApplicationName
));
}
else
{
DWORD
l
=
strlenW
(
sei_tmp
.
lpFile
)
+
1
;
...
...
dlls/shell32/tests/shlexec.c
View file @
943ead50
...
...
@@ -905,6 +905,8 @@ static filename_tests_t filename_tests[]=
{
NULL
,
"%s
\\
masked file.shlexec"
,
0x0
,
33
},
/* Test if quoting prevents the masking */
{
NULL
,
"%s
\\
masked file.shlexec"
,
0x40
,
33
},
/* Test with incorrect quote */
{
NULL
,
"
\"
%s
\\
masked file.shlexec"
,
0x0
,
SE_ERR_FNF
},
{
NULL
,
NULL
,
0
}
};
...
...
@@ -2114,6 +2116,15 @@ static void test_exes(void)
{
win_skip
(
"Skipping shellexecute of file with unassociated extension
\n
"
);
}
/* test combining executable and parameters */
sprintf
(
filename
,
"%s shlexec
\"
%s
\"
Exec"
,
argv0
,
child_file
);
rc
=
shell_execute
(
NULL
,
filename
,
NULL
,
NULL
);
ok
(
rc
==
SE_ERR_FNF
,
"%s returned %lu
\n
"
,
shell_call
,
rc
);
sprintf
(
filename
,
"
\"
%s
\"
shlexec
\"
%s
\"
Exec"
,
argv0
,
child_file
);
rc
=
shell_execute
(
NULL
,
filename
,
NULL
,
NULL
);
ok
(
rc
==
SE_ERR_FNF
,
"%s returned %lu
\n
"
,
shell_call
,
rc
);
}
typedef
struct
...
...
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