mirror of
https://github.com/reactos/reactos.git
synced 2024-07-01 02:10:07 +00:00
- Fix over-reading the input buffer (sometimes by even more than 400 bytes), and hashing random pool contents instead of the specified buffer.
svn path=/trunk/; revision=35831
This commit is contained in:
parent
b93a09c0b1
commit
e1b80cf07e
|
@ -81,11 +81,12 @@ ObpHash(IN PVOID Buffer,
|
|||
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 @@ ObpHash(IN PVOID Buffer,
|
|||
Hash ^= *p++;
|
||||
Hash = _rotl(Hash, 3);
|
||||
}
|
||||
|
||||
|
||||
/* Loop non-aligned data */
|
||||
pb = (PUCHAR)p;
|
||||
while (pb < ppb)
|
||||
|
|
Loading…
Reference in a new issue