Author: hpoussin
Date: Tue Jul 10 17:30:43 2007
New Revision: 27563
URL:
http://svn.reactos.org/svn/reactos?rev=27563&view=rev
Log:
Prevent possible access out of bounds when calculating CPU speed
Modified:
trunk/reactos/ntoskrnl/ke/i386/kiinit.c
Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original)
+++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Tue Jul 10 17:30:43 2007
@@ -227,6 +227,13 @@
/* Move on */
CurrentSample++;
Sample++;
+
+ if (Sample == sizeof(Samples) / sizeof(Samples[0]))
+ {
+ /* Restart */
+ CurrentSample = Samples;
+ Sample = 0;
+ }
}
/* Save the CPU Speed */