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
fdeb6d5a
Commit
fdeb6d5a
authored
Feb 28, 2007
by
Alexander Farber
Committed by
Alexandre Julliard
Mar 01, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd: Fixed 3 buffer overflows when fetching environment variables.
parent
23473ccc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
wcmdmain.c
programs/cmd/wcmdmain.c
+8
-6
No files found.
programs/cmd/wcmdmain.c
View file @
fdeb6d5a
...
...
@@ -672,6 +672,7 @@ void WCMD_run_program (char *command, int called) {
BOOL
extensionsupplied
=
FALSE
;
BOOL
launched
=
FALSE
;
BOOL
status
;
DWORD
len
;
WCMD_parse
(
command
,
quals
,
param1
,
param2
);
/* Quick way to get the filename */
...
...
@@ -681,8 +682,8 @@ void WCMD_run_program (char *command, int called) {
/* Calculate the search path and stem to search for */
if
(
strpbrk
(
param1
,
"/
\\
:"
)
==
NULL
)
{
/* No explicit path given, search path */
strcpy
(
pathtosearch
,
".;"
);
status
=
GetEnvironmentVariable
(
"PATH"
,
&
pathtosearch
[
2
],
sizeof
(
pathtosearch
)
-
2
);
if
((
status
==
0
)
||
(
status
>
sizeof
(
pathtosearch
)
))
{
len
=
GetEnvironmentVariable
(
"PATH"
,
&
pathtosearch
[
2
],
sizeof
(
pathtosearch
)
-
2
);
if
((
len
==
0
)
||
(
len
>=
sizeof
(
pathtosearch
)
-
2
))
{
lstrcpy
(
pathtosearch
,
"."
);
}
if
(
strchr
(
param1
,
'.'
)
!=
NULL
)
extensionsupplied
=
TRUE
;
...
...
@@ -699,8 +700,8 @@ void WCMD_run_program (char *command, int called) {
}
/* Now extract PATHEXT */
status
=
GetEnvironmentVariable
(
"PATHEXT"
,
pathext
,
sizeof
(
pathext
));
if
((
status
==
0
)
||
(
status
>
sizeof
(
pathext
)))
{
len
=
GetEnvironmentVariable
(
"PATHEXT"
,
pathext
,
sizeof
(
pathext
));
if
((
len
==
0
)
||
(
len
>=
sizeof
(
pathext
)))
{
lstrcpy
(
pathext
,
".bat;.com;.cmd;.exe"
);
}
...
...
@@ -857,9 +858,10 @@ void WCMD_show_prompt (void) {
int
status
;
char
out_string
[
MAX_PATH
],
curdir
[
MAX_PATH
],
prompt_string
[
MAX_PATH
];
char
*
p
,
*
q
;
DWORD
len
;
status
=
GetEnvironmentVariable
(
"PROMPT"
,
prompt_string
,
sizeof
(
prompt_string
));
if
((
status
==
0
)
||
(
status
>
sizeof
(
prompt_string
)))
{
len
=
GetEnvironmentVariable
(
"PROMPT"
,
prompt_string
,
sizeof
(
prompt_string
));
if
((
len
==
0
)
||
(
len
>=
sizeof
(
prompt_string
)))
{
lstrcpy
(
prompt_string
,
"$P$G"
);
}
p
=
prompt_string
;
...
...
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