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
8819ae1e
Commit
8819ae1e
authored
Oct 20, 2010
by
Louis Lenders
Committed by
Alexandre Julliard
Oct 22, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Fix GetTempFileName with invalid path.
Found by Oskar Eisemuth.
parent
105793bf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
path.c
dlls/kernel32/path.c
+10
-0
path.c
dlls/kernel32/tests/path.c
+0
-2
No files found.
dlls/kernel32/path.c
View file @
8819ae1e
...
...
@@ -660,6 +660,7 @@ UINT WINAPI GetTempFileNameW( LPCWSTR path, LPCWSTR prefix, UINT unique, LPWSTR
int
i
;
LPWSTR
p
;
DWORD
attr
;
if
(
!
path
||
!
buffer
)
{
...
...
@@ -667,6 +668,15 @@ UINT WINAPI GetTempFileNameW( LPCWSTR path, LPCWSTR prefix, UINT unique, LPWSTR
return
0
;
}
/* ensure that the provided directory exists */
attr
=
GetFileAttributesW
(
path
);
if
(
attr
==
INVALID_FILE_ATTRIBUTES
||
!
(
attr
&
FILE_ATTRIBUTE_DIRECTORY
))
{
TRACE
(
"path not found %s
\n
"
,
debugstr_w
(
path
));
SetLastError
(
ERROR_DIRECTORY
);
return
0
;
}
strcpyW
(
buffer
,
path
);
p
=
buffer
+
strlenW
(
buffer
);
...
...
dlls/kernel32/tests/path.c
View file @
8819ae1e
...
...
@@ -364,9 +364,7 @@ static void test_InitPathA(CHAR *newdir, CHAR *curDrive, CHAR *otherDrive)
/* Non-existent path */
sprintf
(
invalid_dir
,
"%s\%s"
,
tmppath
,
"non_existent_dir_1jwj3y32nb3"
);
SetLastError
(
0xdeadbeef
);
todo_wine
ok
(
!
GetTempFileNameA
(
invalid_dir
,
"tfn"
,
unique
,
newdir
),
"GetTempFileNameA should have failed
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_DIRECTORY
||
broken
(
GetLastError
()
==
ERROR_PATH_NOT_FOUND
)
/*win98*/
,
"got %d, expected ERROR_DIRECTORY
\n
"
,
GetLastError
());
...
...
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