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
01e8a9d0
Commit
01e8a9d0
authored
Jun 01, 2022
by
Rémi Bernon
Committed by
Alexandre Julliard
Jun 02, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dinput/tests: Enforce ioctl buffer sizes to avoid overflows.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
parent
5a1d2b58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
driver_bus.c
dlls/dinput/tests/driver_bus.c
+6
-2
No files found.
dlls/dinput/tests/driver_bus.c
View file @
01e8a9d0
...
...
@@ -1251,18 +1251,22 @@ static NTSTATUS pdo_handle_ioctl( struct phys_device *impl, IRP *irp, ULONG code
switch
(
code
)
{
case
IOCTL_WINETEST_HID_SET_EXPECT
:
if
(
in_size
>
EXPECT_QUEUE_BUFFER_SIZE
)
return
STATUS_BUFFER_OVERFLOW
;
expect_queue_reset
(
&
impl
->
expect_queue
,
in_buffer
,
in_size
);
return
STATUS_SUCCESS
;
case
IOCTL_WINETEST_HID_WAIT_EXPECT
:
{
struct
wait_expect_params
wait_params
=
*
(
struct
wait_expect_params
*
)
in_buffer
;
if
(
!
wait_params
.
wait_pending
)
return
expect_queue_wait
(
&
impl
->
expect_queue
,
irp
);
struct
wait_expect_params
*
wait_params
=
(
struct
wait_expect_params
*
)
in_buffer
;
if
(
in_size
<
sizeof
(
*
wait_params
))
return
STATUS_BUFFER_TOO_SMALL
;
if
(
!
wait_params
->
wait_pending
)
return
expect_queue_wait
(
&
impl
->
expect_queue
,
irp
);
else
return
expect_queue_wait_pending
(
&
impl
->
expect_queue
,
irp
);
}
case
IOCTL_WINETEST_HID_SEND_INPUT
:
if
(
in_size
>
EXPECT_QUEUE_BUFFER_SIZE
)
return
STATUS_BUFFER_OVERFLOW
;
input_queue_reset
(
&
impl
->
input_queue
,
in_buffer
,
in_size
);
return
STATUS_SUCCESS
;
case
IOCTL_WINETEST_HID_SET_CONTEXT
:
if
(
in_size
>
sizeof
(
impl
->
expect_queue
.
context
))
return
STATUS_BUFFER_OVERFLOW
;
KeAcquireSpinLock
(
&
impl
->
expect_queue
.
lock
,
&
irql
);
memcpy
(
impl
->
expect_queue
.
context
,
in_buffer
,
in_size
);
KeReleaseSpinLock
(
&
impl
->
expect_queue
.
lock
,
irql
);
...
...
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