mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 12:26:38 +00:00
- Don't calculate remaining bits if there are none. Fixes out-of-bounds read of a buffer.
- Patch sent to Wine: http://www.winehq.org/pipermail/wine-patches/2008-December/066692.html svn path=/trunk/; revision=38324
This commit is contained in:
parent
ebef3e5d4e
commit
16726f509e
1 changed files with 6 additions and 3 deletions
|
@ -764,9 +764,12 @@ RtlNumberOfSetBits(PRTL_BITMAP BitMapHeader)
|
||||||
lpOut++;
|
lpOut++;
|
||||||
}
|
}
|
||||||
|
|
||||||
bMasked = *lpOut & NTDLL_maskBits[ulRemainder];
|
if (ulRemainder)
|
||||||
ulSet += NTDLL_nibbleBitCount[bMasked >> 4];
|
{
|
||||||
ulSet += NTDLL_nibbleBitCount[bMasked & 0xf];
|
bMasked = *lpOut & NTDLL_maskBits[ulRemainder];
|
||||||
|
ulSet += NTDLL_nibbleBitCount[bMasked >> 4];
|
||||||
|
ulSet += NTDLL_nibbleBitCount[bMasked & 0xf];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ulSet;
|
return ulSet;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue