From d3a5bca37ff52d8117af6e484dd475b707247fb6 Mon Sep 17 00:00:00 2001 From: Aleksey Bragin Date: Fri, 26 Dec 2008 20:21:52 +0000 Subject: [PATCH] - Don't try to set remaining bits if there are none. Fixes memory corruption. Patch sent to Wine: http://www.winehq.org/pipermail/wine-patches/2008-December/066716.html svn path=/trunk/; revision=38359 --- reactos/lib/rtl/bitmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reactos/lib/rtl/bitmap.c b/reactos/lib/rtl/bitmap.c index f2a1f42bd0c..69f06875ae4 100644 --- a/reactos/lib/rtl/bitmap.c +++ b/reactos/lib/rtl/bitmap.c @@ -851,7 +851,8 @@ RtlSetBits(PRTL_BITMAP BitMapHeader, } /* Set remaining bits, if any */ - *lpOut |= NTDLL_maskBits[NumberToSet & 0x7]; + if (NumberToSet & 0x7) + *lpOut |= NTDLL_maskBits[NumberToSet & 0x7]; }