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
17ebac84
Commit
17ebac84
authored
Aug 30, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Aug 31, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mountmgr: Validate the output size for IOCTL_MOUNTMGR_QUERY_POINTS.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c342afef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
11 deletions
+7
-11
volume.c
dlls/kernel32/tests/volume.c
+3
-3
mountmgr.c
dlls/mountmgr.sys/mountmgr.c
+4
-8
No files found.
dlls/kernel32/tests/volume.c
View file @
17ebac84
...
...
@@ -1658,7 +1658,7 @@ static void test_mountmgr_query_points(void)
io
.
Information
=
0xdeadf00d
;
status
=
NtDeviceIoControlFile
(
file
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_MOUNTMGR_QUERY_POINTS
,
input
,
sizeof
(
*
input
),
NULL
,
0
);
todo_wine
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"got %#x
\n
"
,
status
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"got %#x
\n
"
,
status
);
todo_wine
ok
(
io
.
Status
==
0xdeadf00d
,
"got status %#x
\n
"
,
io
.
Status
);
todo_wine
ok
(
io
.
Information
==
0xdeadf00d
,
"got information %#Ix
\n
"
,
io
.
Information
);
...
...
@@ -1667,10 +1667,10 @@ static void test_mountmgr_query_points(void)
memset
(
output
,
0xcc
,
sizeof
(
*
output
));
status
=
NtDeviceIoControlFile
(
file
,
NULL
,
NULL
,
NULL
,
&
io
,
IOCTL_MOUNTMGR_QUERY_POINTS
,
input
,
sizeof
(
*
input
),
output
,
sizeof
(
*
output
)
-
1
);
todo_wine
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"got %#x
\n
"
,
status
);
ok
(
status
==
STATUS_INVALID_PARAMETER
,
"got %#x
\n
"
,
status
);
todo_wine
ok
(
io
.
Status
==
0xdeadf00d
,
"got status %#x
\n
"
,
io
.
Status
);
todo_wine
ok
(
io
.
Information
==
0xdeadf00d
,
"got information %#Ix
\n
"
,
io
.
Information
);
todo_wine
ok
(
output
->
Size
==
0xcccccccc
,
"got size %u
\n
"
,
output
->
Size
);
ok
(
output
->
Size
==
0xcccccccc
,
"got size %u
\n
"
,
output
->
Size
);
ok
(
output
->
NumberOfMountPoints
==
0xcccccccc
,
"got count %u
\n
"
,
output
->
NumberOfMountPoints
);
io
.
Status
=
0xdeadf00d
;
...
...
dlls/mountmgr.sys/mountmgr.c
View file @
17ebac84
...
...
@@ -168,8 +168,9 @@ static NTSTATUS query_mount_points( void *buff, SIZE_T insize,
MOUNTMGR_MOUNT_POINTS
*
info
;
struct
mount_point
*
mount
;
/* sanity checks */
if
(
input
->
SymbolicLinkNameOffset
+
input
->
SymbolicLinkNameLength
>
insize
||
if
(
insize
<
sizeof
(
*
input
)
||
outsize
<
sizeof
(
*
info
)
||
input
->
SymbolicLinkNameOffset
+
input
->
SymbolicLinkNameLength
>
insize
||
input
->
UniqueIdOffset
+
input
->
UniqueIdLength
>
insize
||
input
->
DeviceNameOffset
+
input
->
DeviceNameLength
>
insize
||
input
->
SymbolicLinkNameOffset
+
input
->
SymbolicLinkNameLength
<
input
->
SymbolicLinkNameOffset
||
...
...
@@ -193,7 +194,7 @@ static NTSTATUS query_mount_points( void *buff, SIZE_T insize,
if
(
size
>
outsize
)
{
info
=
buff
;
i
f
(
size
>=
sizeof
(
info
->
Size
))
i
nfo
->
Size
=
size
;
info
->
Size
=
size
;
iosb
->
Information
=
sizeof
(
info
->
Size
);
return
STATUS_MORE_ENTRIES
;
}
...
...
@@ -907,11 +908,6 @@ static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp )
switch
(
irpsp
->
Parameters
.
DeviceIoControl
.
IoControlCode
)
{
case
IOCTL_MOUNTMGR_QUERY_POINTS
:
if
(
irpsp
->
Parameters
.
DeviceIoControl
.
InputBufferLength
<
sizeof
(
MOUNTMGR_MOUNT_POINT
))
{
status
=
STATUS_INVALID_PARAMETER
;
break
;
}
status
=
query_mount_points
(
irp
->
AssociatedIrp
.
SystemBuffer
,
irpsp
->
Parameters
.
DeviceIoControl
.
InputBufferLength
,
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
,
...
...
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