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
ded81aeb
Commit
ded81aeb
authored
Sep 10, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Add validity checks on the size of the handle inheritance block.
parent
2d791e8c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
file.c
dlls/msvcrt/file.c
+10
-8
No files found.
dlls/msvcrt/file.c
View file @
ded81aeb
...
...
@@ -349,18 +349,19 @@ void msvcrt_init_io(void)
InitializeCriticalSection
(
&
MSVCRT_file_cs
);
MSVCRT_file_cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": MSVCRT_file_cs"
);
GetStartupInfoA
(
&
si
);
if
(
si
.
cbReserved2
!=
0
&&
si
.
lpReserved2
!=
NULL
)
if
(
si
.
cbReserved2
>=
sizeof
(
unsigned
int
)
&&
si
.
lpReserved2
!=
NULL
)
{
char
*
wxflag_ptr
;
BYTE
*
wxflag_ptr
;
HANDLE
*
handle_ptr
;
unsigned
int
count
;
MSVCRT_fdend
=
*
(
unsigned
*
)
si
.
lpReserved2
;
count
=
*
(
unsigned
*
)
si
.
lpReserved2
;
wxflag_ptr
=
si
.
lpReserved2
+
sizeof
(
unsigned
);
handle_ptr
=
(
HANDLE
*
)(
wxflag_ptr
+
count
);
wxflag_ptr
=
(
char
*
)(
si
.
lpReserved2
+
sizeof
(
unsigned
));
handle_ptr
=
(
HANDLE
*
)(
wxflag_ptr
+
MSVCRT_fdend
*
sizeof
(
char
));
MSVCRT_fdend
=
min
(
MSVCRT_fdend
,
sizeof
(
MSVCRT_fdesc
)
/
sizeof
(
MSVCRT_fdesc
[
0
]));
for
(
i
=
0
;
i
<
MSVCRT_fdend
;
i
++
)
count
=
min
(
count
,
(
si
.
cbReserved2
-
sizeof
(
unsigned
))
/
(
sizeof
(
HANDLE
)
+
1
));
count
=
min
(
count
,
sizeof
(
MSVCRT_fdesc
)
/
sizeof
(
MSVCRT_fdesc
[
0
]));
for
(
i
=
0
;
i
<
count
;
i
++
)
{
if
((
*
wxflag_ptr
&
WX_OPEN
)
&&
*
handle_ptr
!=
INVALID_HANDLE_VALUE
)
{
...
...
@@ -374,6 +375,7 @@ void msvcrt_init_io(void)
}
wxflag_ptr
++
;
handle_ptr
++
;
}
MSVCRT_fdend
=
max
(
3
,
count
);
for
(
MSVCRT_fdstart
=
3
;
MSVCRT_fdstart
<
MSVCRT_fdend
;
MSVCRT_fdstart
++
)
if
(
MSVCRT_fdesc
[
MSVCRT_fdstart
].
handle
==
INVALID_HANDLE_VALUE
)
break
;
}
...
...
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