mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +00:00
- Fix buffer overflow if mouse packets are arriving faster than we can
pass them to the callback. svn path=/trunk/; revision=5231
This commit is contained in:
parent
6e6bff4228
commit
e891a5adeb
|
@ -69,6 +69,9 @@ ps2_mouse_handler(PKINTERRUPT Interrupt, PVOID ServiceContext)
|
|||
DeviceExtension = (PDEVICE_EXTENSION)DeviceObject->DeviceExtension;
|
||||
Queue = DeviceExtension->ActiveQueue % 2;
|
||||
|
||||
/* Reset the buffer state. */
|
||||
mouse_buffer_position = 0;
|
||||
|
||||
/* Prevent buffer overflow */
|
||||
if (DeviceExtension->InputDataCount[Queue] == MOUSE_BUFFER_SIZE)
|
||||
{
|
||||
|
@ -76,9 +79,7 @@ ps2_mouse_handler(PKINTERRUPT Interrupt, PVOID ServiceContext)
|
|||
}
|
||||
|
||||
Input = &DeviceExtension->MouseInputData[Queue]
|
||||
[DeviceExtension->InputDataCount[Queue]];
|
||||
|
||||
mouse_buffer_position = 0;
|
||||
[DeviceExtension->InputDataCount[Queue]];
|
||||
|
||||
/* Determine the current state of the buttons */
|
||||
Input->RawButtons = (mouse_buffer[0] & 1) /* * GPM_B_LEFT */ +
|
||||
|
|
Loading…
Reference in a new issue