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
93f99fba
Commit
93f99fba
authored
Feb 15, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Don't crash on NULL argument in _wgetenv.
(cherry picked from commit
d812af3f
)
parent
8d2a7f6b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
environ.c
dlls/msvcrt/environ.c
+5
-2
No files found.
dlls/msvcrt/environ.c
View file @
93f99fba
...
@@ -55,7 +55,10 @@ char * CDECL getenv(const char *name)
...
@@ -55,7 +55,10 @@ char * CDECL getenv(const char *name)
wchar_t
*
CDECL
_wgetenv
(
const
wchar_t
*
name
)
wchar_t
*
CDECL
_wgetenv
(
const
wchar_t
*
name
)
{
{
wchar_t
**
env
;
wchar_t
**
env
;
unsigned
int
length
=
wcslen
(
name
);
size_t
len
;
if
(
!
MSVCRT_CHECK_PMT
(
name
!=
NULL
))
return
NULL
;
len
=
wcslen
(
name
);
/* Initialize the _wenviron array if it's not already created. */
/* Initialize the _wenviron array if it's not already created. */
if
(
!
MSVCRT__wenviron
)
if
(
!
MSVCRT__wenviron
)
...
@@ -65,7 +68,7 @@ wchar_t * CDECL _wgetenv(const wchar_t *name)
...
@@ -65,7 +68,7 @@ wchar_t * CDECL _wgetenv(const wchar_t *name)
{
{
wchar_t
*
str
=
*
env
;
wchar_t
*
str
=
*
env
;
wchar_t
*
pos
=
wcschr
(
str
,
'='
);
wchar_t
*
pos
=
wcschr
(
str
,
'='
);
if
(
pos
&&
((
pos
-
str
)
==
len
gth
)
&&
!
_wcsnicmp
(
str
,
name
,
length
))
if
(
pos
&&
((
pos
-
str
)
==
len
)
&&
!
_wcsnicmp
(
str
,
name
,
len
))
{
{
TRACE
(
"(%s): got %s
\n
"
,
debugstr_w
(
name
),
debugstr_w
(
pos
+
1
));
TRACE
(
"(%s): got %s
\n
"
,
debugstr_w
(
name
),
debugstr_w
(
pos
+
1
));
return
pos
+
1
;
return
pos
+
1
;
...
...
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