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
b829f034
Commit
b829f034
authored
Nov 16, 2007
by
Juan Lang
Committed by
Alexandre Julliard
Nov 19, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Dynamically allocate buffer for quoted command.
parent
e3dbbd14
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletion
+12
-1
shlexec.c
dlls/shell32/shlexec.c
+12
-1
No files found.
dlls/shell32/shlexec.c
View file @
b829f034
...
...
@@ -1371,7 +1371,17 @@ static UINT_PTR SHELL_quote_and_execute( LPCWSTR wcmd, LPCWSTR wszParameters, LP
static
const
WCHAR
wQuote
[]
=
{
'"'
,
0
};
static
const
WCHAR
wSpace
[]
=
{
' '
,
0
};
UINT_PTR
retval
;
WCHAR
wszQuotedCmd
[
MAX_PATH
+
2
];
DWORD
len
;
WCHAR
*
wszQuotedCmd
;
/* Length of quotes plus length of command plus NULL terminator */
len
=
2
+
lstrlenW
(
wcmd
)
+
1
;
if
(
wszParameters
[
0
])
{
/* Length of space plus length of parameters */
len
+=
1
+
lstrlenW
(
wszParameters
);
}
wszQuotedCmd
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
));
/* Must quote to handle case where cmd contains spaces,
* else security hole if malicious user creates executable file "C:\\Program"
*/
...
...
@@ -1387,6 +1397,7 @@ static UINT_PTR SHELL_quote_and_execute( LPCWSTR wcmd, LPCWSTR wszParameters, LP
retval
=
execute_from_key
(
lpstrProtocol
,
wszApplicationName
,
env
,
psei
->
lpParameters
,
wcmd
,
execfunc
,
psei
,
psei_out
);
else
retval
=
execfunc
(
wszQuotedCmd
,
env
,
FALSE
,
psei
,
psei_out
);
HeapFree
(
GetProcessHeap
(),
0
,
wszQuotedCmd
);
return
retval
;
}
...
...
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