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
f16cf541
Commit
f16cf541
authored
Feb 28, 2015
by
Bruno Jesus
Committed by
Alexandre Julliard
Mar 02, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: GetTempPathW must zero the remaining buffer.
parent
050bda2e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
path.c
dlls/kernel32/path.c
+5
-1
path.c
dlls/kernel32/tests/path.c
+0
-1
No files found.
dlls/kernel32/path.c
View file @
f16cf541
...
...
@@ -623,9 +623,13 @@ DWORD WINAPI GetTempPathW( DWORD count, LPWSTR path )
if
(
count
)
{
lstrcpynW
(
path
,
tmp_path
,
coun
t
);
lstrcpynW
(
path
,
tmp_path
,
re
t
);
if
(
count
>=
ret
)
{
/* the remaining buffer must be zeroed */
memset
(
path
+
ret
,
0
,
(
count
-
ret
)
*
sizeof
(
WCHAR
));
ret
--
;
/* return length without 0 */
}
else
if
(
count
<
4
)
path
[
0
]
=
0
;
/* avoid returning ambiguous "X:" */
}
...
...
dlls/kernel32/tests/path.c
View file @
f16cf541
...
...
@@ -1012,7 +1012,6 @@ static void test_GetTempPathW(char* tmp_dir)
ok
(
len
==
lstrlenW
(
buf
),
"returned length should be equal to the length of string
\n
"
);
/* The rest of the buffer must be zeroed */
for
(
len
++
;
len
<
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]);
len
++
)
todo_wine
ok
(
buf
[
len
]
==
'\0'
,
"expected NULL at [%d], got 0x%x
\n
"
,
len
,
buf
[
len
]);
}
...
...
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