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
392648dd
Commit
392648dd
authored
Sep 27, 2019
by
Piotr Caban
Committed by
Alexandre Julliard
Sep 30, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Don't use uninitialized ofs->szPathName in OpenFile.
Signed-off-by:
Piotr Caban
<
piotr@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
78f6d671
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
file.c
dlls/kernel32/file.c
+14
-2
No files found.
dlls/kernel32/file.c
View file @
392648dd
...
...
@@ -1166,6 +1166,7 @@ HFILE WINAPI OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode )
HANDLE
handle
;
FILETIME
filetime
;
WORD
filedatetime
[
2
];
DWORD
len
;
if
(
!
ofs
)
return
HFILE_ERROR
;
...
...
@@ -1201,7 +1202,13 @@ HFILE WINAPI OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode )
/* the watcom 10.6 IDE relies on a valid path returned in ofs->szPathName
Are there any cases where getting the path here is wrong?
Uwe Bonnes 1997 Apr 2 */
if
(
!
GetFullPathNameA
(
name
,
sizeof
(
ofs
->
szPathName
),
ofs
->
szPathName
,
NULL
))
goto
error
;
len
=
GetFullPathNameA
(
name
,
sizeof
(
ofs
->
szPathName
),
ofs
->
szPathName
,
NULL
);
if
(
!
len
)
goto
error
;
if
(
len
>=
sizeof
(
ofs
->
szPathName
))
{
SetLastError
(
ERROR_INVALID_DATA
);
goto
error
;
}
/* OF_PARSE simply fills the structure */
...
...
@@ -1224,8 +1231,13 @@ HFILE WINAPI OpenFile( LPCSTR name, OFSTRUCT *ofs, UINT mode )
{
/* Now look for the file */
if
(
!
SearchPathA
(
NULL
,
name
,
NULL
,
sizeof
(
ofs
->
szPathName
),
ofs
->
szPathName
,
NULL
))
len
=
SearchPathA
(
NULL
,
name
,
NULL
,
sizeof
(
ofs
->
szPathName
),
ofs
->
szPathName
,
NULL
);
if
(
!
len
)
goto
error
;
if
(
len
>=
sizeof
(
ofs
->
szPathName
))
{
SetLastError
(
ERROR_INVALID_DATA
);
goto
error
;
}
TRACE
(
"found %s
\n
"
,
debugstr_a
(
ofs
->
szPathName
)
);
...
...
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