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
1bd0f4f0
Commit
1bd0f4f0
authored
Jul 23, 2014
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Avoid useless PATH changes and avoid buffer overflow in set_environment.
parent
60311080
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
9 deletions
+21
-9
nsembed.c
dlls/mshtml/nsembed.c
+21
-9
No files found.
dlls/mshtml/nsembed.c
View file @
1bd0f4f0
...
@@ -438,8 +438,10 @@ static BOOL install_wine_gecko(void)
...
@@ -438,8 +438,10 @@ static BOOL install_wine_gecko(void)
static
void
set_environment
(
LPCWSTR
gre_path
)
static
void
set_environment
(
LPCWSTR
gre_path
)
{
{
WCHAR
path_env
[
MAX_PATH
],
buf
[
20
];
size_t
len
,
gre_path_len
;
int
len
,
debug_level
=
0
;
int
debug_level
=
0
;
WCHAR
*
path
,
buf
[
20
];
const
WCHAR
*
ptr
;
static
const
WCHAR
pathW
[]
=
{
'P'
,
'A'
,
'T'
,
'H'
,
0
};
static
const
WCHAR
pathW
[]
=
{
'P'
,
'A'
,
'T'
,
'H'
,
0
};
static
const
WCHAR
warnW
[]
=
{
'w'
,
'a'
,
'r'
,
'n'
,
0
};
static
const
WCHAR
warnW
[]
=
{
'w'
,
'a'
,
'r'
,
'n'
,
0
};
...
@@ -449,13 +451,6 @@ static void set_environment(LPCWSTR gre_path)
...
@@ -449,13 +451,6 @@ static void set_environment(LPCWSTR gre_path)
{
'N'
,
'S'
,
'P'
,
'R'
,
'_'
,
'L'
,
'O'
,
'G'
,
'_'
,
'M'
,
'O'
,
'D'
,
'U'
,
'L'
,
'E'
,
'S'
,
0
};
{
'N'
,
'S'
,
'P'
,
'R'
,
'_'
,
'L'
,
'O'
,
'G'
,
'_'
,
'M'
,
'O'
,
'D'
,
'U'
,
'L'
,
'E'
,
'S'
,
0
};
static
const
WCHAR
debug_formatW
[]
=
{
'a'
,
'l'
,
'l'
,
':'
,
'%'
,
'd'
,
0
};
static
const
WCHAR
debug_formatW
[]
=
{
'a'
,
'l'
,
'l'
,
':'
,
'%'
,
'd'
,
0
};
/* We have to modify PATH as XPCOM loads other DLLs from this directory. */
GetEnvironmentVariableW
(
pathW
,
path_env
,
sizeof
(
path_env
)
/
sizeof
(
WCHAR
));
len
=
strlenW
(
path_env
);
path_env
[
len
++
]
=
';'
;
strcpyW
(
path_env
+
len
,
gre_path
);
SetEnvironmentVariableW
(
pathW
,
path_env
);
SetEnvironmentVariableW
(
xpcom_debug_breakW
,
warnW
);
SetEnvironmentVariableW
(
xpcom_debug_breakW
,
warnW
);
if
(
TRACE_ON
(
gecko
))
if
(
TRACE_ON
(
gecko
))
...
@@ -467,6 +462,23 @@ static void set_environment(LPCWSTR gre_path)
...
@@ -467,6 +462,23 @@ static void set_environment(LPCWSTR gre_path)
sprintfW
(
buf
,
debug_formatW
,
debug_level
);
sprintfW
(
buf
,
debug_formatW
,
debug_level
);
SetEnvironmentVariableW
(
nspr_log_modulesW
,
buf
);
SetEnvironmentVariableW
(
nspr_log_modulesW
,
buf
);
len
=
GetEnvironmentVariableW
(
pathW
,
NULL
,
0
);
gre_path_len
=
strlenW
(
gre_path
);
path
=
heap_alloc
((
len
+
gre_path_len
+
1
)
*
sizeof
(
WCHAR
));
if
(
!
path
)
return
;
GetEnvironmentVariableW
(
pathW
,
path
,
len
);
/* We have to modify PATH as xul.dll loads other DLLs from this directory. */
if
(
!
(
ptr
=
strstrW
(
path
,
gre_path
))
||
(
ptr
>
path
&&
*
(
ptr
-
1
)
!=
';'
)
||
(
ptr
[
gre_path_len
]
&&
ptr
[
gre_path_len
]
!=
';'
))
{
if
(
len
)
path
[
len
-
1
]
=
';'
;
strcpyW
(
path
+
len
,
gre_path
);
SetEnvironmentVariableW
(
pathW
,
path
);
}
}
}
static
BOOL
load_xul
(
const
PRUnichar
*
gre_path
)
static
BOOL
load_xul
(
const
PRUnichar
*
gre_path
)
...
...
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