Author: fireball
Date: Sun Aug 31 06:55:17 2008
New Revision: 35831
URL:
http://svn.reactos.org/svn/reactos?rev=35831&view=rev
Log:
- Fix over-reading the input buffer (sometimes by even more than 400 bytes), and hashing
random pool contents instead of the specified buffer.
Modified:
trunk/reactos/ntoskrnl/ob/obsdcach.c
Modified: trunk/reactos/ntoskrnl/ob/obsdcach.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ob/obsdcach.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ob/obsdcach.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ob/obsdcach.c [iso-8859-1] Sun Aug 31 06:55:17 2008
@@ -81,11 +81,12 @@
PULONG p, pp;
PUCHAR pb, ppb;
ULONG Hash = 0;
-
+
/* Setup aligned and byte buffers */
p = Buffer;
+ pb = (PUCHAR)p;
ppb = (PUCHAR)((ULONG_PTR)Buffer + Length);
- pp = (PULONG)ALIGN_DOWN(p + Length, ULONG);
+ pp = (PULONG)ALIGN_DOWN(pb + Length, ULONG);
/* Loop aligned data */
while (p < pp)
@@ -94,7 +95,7 @@
Hash ^= *p++;
Hash = _rotl(Hash, 3);
}
-
+
/* Loop non-aligned data */
pb = (PUCHAR)p;
while (pb < ppb)