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
5a08eab3
Commit
5a08eab3
authored
Feb 23, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 23, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix _dupenv_s behavior with missing env var.
parent
6017344e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
msvcr80.c
dlls/msvcr80/tests/msvcr80.c
+0
-3
environ.c
dlls/msvcrt/environ.c
+6
-1
No files found.
dlls/msvcr80/tests/msvcr80.c
View file @
5a08eab3
...
@@ -197,11 +197,8 @@ static void test_dupenv_s(void)
...
@@ -197,11 +197,8 @@ static void test_dupenv_s(void)
len
=
0xdeadbeef
;
len
=
0xdeadbeef
;
tmp
=
(
void
*
)
0xdeadbeef
;
tmp
=
(
void
*
)
0xdeadbeef
;
ret
=
p_dupenv_s
(
&
tmp
,
&
len
,
"nonexistent"
);
ret
=
p_dupenv_s
(
&
tmp
,
&
len
,
"nonexistent"
);
todo_wine
ok
(
!
ret
,
"_dupenv_s returned %d
\n
"
,
ret
);
ok
(
!
ret
,
"_dupenv_s returned %d
\n
"
,
ret
);
todo_wine
ok
(
!
len
,
"_dupenv_s returned length is %Id
\n
"
,
len
);
ok
(
!
len
,
"_dupenv_s returned length is %Id
\n
"
,
len
);
todo_wine
ok
(
!
tmp
,
"_dupenv_s returned pointer is %p
\n
"
,
tmp
);
ok
(
!
tmp
,
"_dupenv_s returned pointer is %p
\n
"
,
tmp
);
}
}
...
...
dlls/msvcrt/environ.c
View file @
5a08eab3
...
@@ -249,7 +249,12 @@ int CDECL _dupenv_s(char **buffer, size_t *numberOfElements, const char *varname
...
@@ -249,7 +249,12 @@ int CDECL _dupenv_s(char **buffer, size_t *numberOfElements, const char *varname
if
(
!
MSVCRT_CHECK_PMT
(
buffer
!=
NULL
))
return
EINVAL
;
if
(
!
MSVCRT_CHECK_PMT
(
buffer
!=
NULL
))
return
EINVAL
;
if
(
!
MSVCRT_CHECK_PMT
(
varname
!=
NULL
))
return
EINVAL
;
if
(
!
MSVCRT_CHECK_PMT
(
varname
!=
NULL
))
return
EINVAL
;
if
(
!
(
e
=
getenv
(
varname
)))
return
*
_errno
()
=
EINVAL
;
if
(
!
(
e
=
getenv
(
varname
)))
{
*
buffer
=
NULL
;
if
(
numberOfElements
)
*
numberOfElements
=
0
;
return
0
;
}
sz
=
strlen
(
e
)
+
1
;
sz
=
strlen
(
e
)
+
1
;
if
(
!
(
*
buffer
=
malloc
(
sz
)))
if
(
!
(
*
buffer
=
malloc
(
sz
)))
...
...
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