[ros-diffs] [fireball] 35831: - Fix over-reading the input buffer (sometimes by even more than 400 bytes), and hashing random pool contents instead of the specified buffer.

fireball at svn.reactos.org fireball at svn.reactos.org
Sun Aug 31 13:55:18 CEST 2008


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=35831&r1=35830&r2=35831&view=diff
==============================================================================
--- 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)



More information about the Ros-diffs mailing list