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
95931fcd
Commit
95931fcd
authored
Nov 23, 2021
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Fix a buffer overflow in environment variable expansion.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=52093
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5784c80b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
env.c
dlls/ntdll/unix/env.c
+2
-2
No files found.
dlls/ntdll/unix/env.c
View file @
95931fcd
...
...
@@ -1321,7 +1321,7 @@ static void add_dynamic_environment( WCHAR **env, SIZE_T *pos, SIZE_T *size )
static
WCHAR
*
expand_value
(
WCHAR
*
env
,
SIZE_T
size
,
const
WCHAR
*
src
,
SIZE_T
src_len
)
{
SIZE_T
len
,
retlen
=
src_len
,
count
=
0
;
SIZE_T
len
,
retlen
=
src_len
+
1
,
count
=
0
;
const
WCHAR
*
var
;
WCHAR
*
ret
;
...
...
@@ -1364,7 +1364,7 @@ static WCHAR *expand_value( WCHAR *env, SIZE_T size, const WCHAR *src, SIZE_T sr
}
if
(
len
>=
retlen
-
count
)
{
retlen
*=
2
;
retlen
=
max
(
retlen
*
2
,
count
+
len
+
1
)
;
ret
=
realloc
(
ret
,
retlen
*
sizeof
(
WCHAR
)
);
}
memcpy
(
ret
+
count
,
var
,
len
*
sizeof
(
WCHAR
)
);
...
...
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