From: Michał Janiszewski janisozaur@gmail.com
Signed-off-by: Michał Janiszewski janisozaur@gmail.com --- dlls/ntdll/rtlbitmap.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/rtlbitmap.c b/dlls/ntdll/rtlbitmap.c index 318f6fcbd4..c3e9385ec0 100644 --- a/dlls/ntdll/rtlbitmap.c +++ b/dlls/ntdll/rtlbitmap.c @@ -157,7 +157,8 @@ VOID WINAPI RtlSetBits(PRTL_BITMAP lpBits, ULONG ulStart, ULONG ulCount) USHORT initialWord = NTDLL_maskBits[ulCount] << (ulStart & 7);
*lpOut++ |= (initialWord & 0xff); - *lpOut |= (initialWord >> 8); + if (lpOut < ((BYTE *)lpBits->Buffer) + (lpBits->SizeOfBitMap / 8)) + *lpOut |= (initialWord >> 8); return; } } @@ -218,7 +219,8 @@ VOID WINAPI RtlClearBits(PRTL_BITMAP lpBits, ULONG ulStart, ULONG ulCount) USHORT initialWord = ~(NTDLL_maskBits[ulCount] << (ulStart & 7));
*lpOut++ &= (initialWord & 0xff); - *lpOut &= (initialWord >> 8); + if (lpOut < ((BYTE *)lpBits->Buffer) + (lpBits->SizeOfBitMap / 8)) + *lpOut &= (initialWord >> 8); return; } }