Author: dgorbachev
Date: Tue Jul 26 03:24:48 2011
New Revision: 52887
URL:
http://svn.reactos.org/svn/reactos?rev=52887&view=rev
Log:
[WIN32K]
Do not go beyond the MouseHistoryOfMoves[] bounds. Fixes a crash in Win32k.
Modified:
trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/msgqueue.c [iso-8859-1] Tue Jul 26
03:24:48 2011
@@ -616,7 +616,8 @@
MouseHistoryOfMoves[gcur_count].y = Msg->pt.y;
MouseHistoryOfMoves[gcur_count].time = Msg->time;
MouseHistoryOfMoves[gcur_count].dwExtraInfo = dwExtraInfo;
- if (gcur_count++ == 64) gcur_count = 0; // 0 - 63 is 64, FIFO forwards.
+ if (++gcur_count == ARRAYSIZE(MouseHistoryOfMoves))
+ gcur_count = 0; // 0 - 63 is 64, FIFO forwards.
}
//