projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ba3759f
)
[RTL]
author
Thomas Faber
<thomas.faber@reactos.org>
Mon, 31 Mar 2014 19:57:42 +0000
(19:57 +0000)
committer
Thomas Faber
<thomas.faber@reactos.org>
Mon, 31 Mar 2014 19:57:42 +0000
(19:57 +0000)
- Fix buffer overrun in RtlNumberOfSetBits
svn path=/trunk/; revision=62591
reactos/lib/rtl/bitmap.c
patch
|
blob
|
history
diff --git
a/reactos/lib/rtl/bitmap.c
b/reactos/lib/rtl/bitmap.c
index
b009355
..
6ceddf9
100644
(file)
--- a/
reactos/lib/rtl/bitmap.c
+++ b/
reactos/lib/rtl/bitmap.c
@@
-467,8
+467,11
@@
RtlNumberOfSetBits(
BitCount += BitCountTable[*Byte++];
}
- Shift = 8 - (BitMapHeader->SizeOfBitMap & 7);
- BitCount += BitCountTable[((*Byte) << Shift) & 0xFF];
+ if (BitMapHeader->SizeOfBitMap & 7)
+ {
+ Shift = 8 - (BitMapHeader->SizeOfBitMap & 7);
+ BitCount += BitCountTable[((*Byte) << Shift) & 0xFF];
+ }
return BitCount;
}