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
024ece50
Commit
024ece50
authored
Aug 26, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Aug 26, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Fix parameter validation in _stat64 function.
parent
0988938d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
file.c
dlls/msvcrt/file.c
+4
-2
file.c
dlls/msvcrt/tests/file.c
+10
-0
No files found.
dlls/msvcrt/file.c
View file @
024ece50
...
@@ -2684,7 +2684,8 @@ int CDECL MSVCRT_stat64(const char* path, struct MSVCRT__stat64 * buf)
...
@@ -2684,7 +2684,8 @@ int CDECL MSVCRT_stat64(const char* path, struct MSVCRT__stat64 * buf)
while
(
plen
&&
path
[
plen
-
1
]
==
' '
)
while
(
plen
&&
path
[
plen
-
1
]
==
' '
)
plen
--
;
plen
--
;
if
(
plen
&&
(
path
[
plen
-
1
]
==
'\\'
||
path
[
plen
-
1
]
==
'/'
))
if
(
plen
&&
(
plen
<
2
||
path
[
plen
-
2
]
!=
':'
)
&&
(
path
[
plen
-
1
]
==
':'
||
path
[
plen
-
1
]
==
'\\'
||
path
[
plen
-
1
]
==
'/'
))
{
{
*
MSVCRT__errno
()
=
MSVCRT_ENOENT
;
*
MSVCRT__errno
()
=
MSVCRT_ENOENT
;
return
-
1
;
return
-
1
;
...
@@ -2784,7 +2785,8 @@ int CDECL MSVCRT__wstat64(const MSVCRT_wchar_t* path, struct MSVCRT__stat64 * bu
...
@@ -2784,7 +2785,8 @@ int CDECL MSVCRT__wstat64(const MSVCRT_wchar_t* path, struct MSVCRT__stat64 * bu
while
(
plen
&&
path
[
plen
-
1
]
==
' '
)
while
(
plen
&&
path
[
plen
-
1
]
==
' '
)
plen
--
;
plen
--
;
if
(
plen
&&
(
path
[
plen
-
1
]
==
'\\'
||
path
[
plen
-
1
]
==
'/'
))
if
(
plen
&&
(
plen
<
2
||
path
[
plen
-
2
]
!=
':'
)
&&
(
path
[
plen
-
1
]
==
':'
||
path
[
plen
-
1
]
==
'\\'
||
path
[
plen
-
1
]
==
'/'
))
{
{
*
MSVCRT__errno
()
=
MSVCRT_ENOENT
;
*
MSVCRT__errno
()
=
MSVCRT_ENOENT
;
return
-
1
;
return
-
1
;
...
...
dlls/msvcrt/tests/file.c
View file @
024ece50
...
@@ -1907,6 +1907,16 @@ static void test_stat(void)
...
@@ -1907,6 +1907,16 @@ static void test_stat(void)
}
}
else
else
skip
(
"mkdir failed with errno %d
\n
"
,
errno
);
skip
(
"mkdir failed with errno %d
\n
"
,
errno
);
errno
=
0xdeadbeef
;
ret
=
stat
(
"c:"
,
&
buf
);
ok
(
ret
==
-
1
,
"stat returned %d
\n
"
,
ret
);
ok
(
errno
==
ENOENT
,
"errno = %d
\n
"
,
errno
);
ret
=
stat
(
"c:/"
,
&
buf
);
ok
(
!
ret
,
"stat returned %d
\n
"
,
ret
);
ok
(
buf
.
st_dev
==
2
,
"st_dev = %d
\n
"
,
buf
.
st_dev
);
ok
(
buf
.
st_rdev
==
2
,
"st_rdev = %d
\n
"
,
buf
.
st_rdev
);
}
}
static
const
char
*
pipe_string
=
"Hello world"
;
static
const
char
*
pipe_string
=
"Hello world"
;
...
...
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