mirror of
https://github.com/reactos/wine.git
synced 2024-11-24 20:30:01 +00:00
ntdll: Fix buffer overread in RtlNumberOfSetBits.
This commit is contained in:
parent
1b3feb2a5c
commit
4f74de5b36
@ -555,9 +555,12 @@ ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP lpBits)
|
||||
lpOut++;
|
||||
}
|
||||
|
||||
bMasked = *lpOut & NTDLL_maskBits[ulRemainder];
|
||||
ulSet += NTDLL_nibbleBitCount[bMasked >> 4];
|
||||
ulSet += NTDLL_nibbleBitCount[bMasked & 0xf];
|
||||
if (ulRemainder)
|
||||
{
|
||||
bMasked = *lpOut & NTDLL_maskBits[ulRemainder];
|
||||
ulSet += NTDLL_nibbleBitCount[bMasked >> 4];
|
||||
ulSet += NTDLL_nibbleBitCount[bMasked & 0xf];
|
||||
}
|
||||
}
|
||||
return ulSet;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user