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
5a469f1b
Commit
5a469f1b
authored
Jan 06, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
Jan 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Ensure environment variables fit in memory.
parent
de09e9b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
batch.c
programs/cmd/batch.c
+12
-4
No files found.
programs/cmd/batch.c
View file @
5a469f1b
...
...
@@ -496,15 +496,23 @@ void WCMD_HandleTildaModifiers(WCHAR **start, BOOL atExecute)
WCHAR
*
begin
=
strchrW
(
firstModifier
,
'$'
)
+
1
;
WCHAR
*
end
=
strchrW
(
firstModifier
,
':'
);
WCHAR
env
[
MAX_PATH
];
WCHAR
fullpath
[
MAX_PATH
]
;
DWORD
size
;
/* Extract the env var */
memcpy
(
env
,
begin
,
(
end
-
begin
)
*
sizeof
(
WCHAR
));
env
[(
end
-
begin
)]
=
0x00
;
/* If env var not found, return empty string */
if
((
GetEnvironmentVariableW
(
env
,
fullpath
,
MAX_PATH
)
==
0
)
||
(
SearchPathW
(
fullpath
,
outputparam
,
NULL
,
MAX_PATH
,
outputparam
,
NULL
)
==
0
))
{
size
=
GetEnvironmentVariableW
(
env
,
NULL
,
0
);
if
(
size
>
0
)
{
WCHAR
*
fullpath
=
heap_alloc
(
size
*
sizeof
(
WCHAR
));
if
(
!
fullpath
||
(
GetEnvironmentVariableW
(
env
,
fullpath
,
size
)
==
0
)
||
(
SearchPathW
(
fullpath
,
outputparam
,
NULL
,
MAX_PATH
,
outputparam
,
NULL
)
==
0
))
size
=
0
;
heap_free
(
fullpath
);
}
if
(
!
size
)
{
/* If env var not found, return empty string */
finaloutput
[
0
]
=
0x00
;
outputparam
[
0
]
=
0x00
;
skipFileParsing
=
TRUE
;
...
...
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