Author: fireball
Date: Thu Oct 4 00:58:44 2007
New Revision: 29387
URL:
http://svn.reactos.org/svn/reactos?rev=29387&view=rev
Log:
- Don't try to copy an uninitialized bitmap's contents (it worked only because it
was zeroed, and thus zero-size RtlCopy and ExFreePool(NULL)).
Modified:
trunk/reactos/lib/cmlib/hivebin.c
Modified: trunk/reactos/lib/cmlib/hivebin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/cmlib/hivebin.c?rev=29…
==============================================================================
--- trunk/reactos/lib/cmlib/hivebin.c (original)
+++ trunk/reactos/lib/cmlib/hivebin.c Thu Oct 4 00:58:44 2007
@@ -80,10 +80,14 @@
BitmapBuffer = RegistryHive->Allocate(BitmapSize, TRUE);
RtlZeroMemory(BitmapBuffer, BitmapSize);
- RtlCopyMemory(BitmapBuffer,
- RegistryHive->DirtyVector.Buffer,
- RegistryHive->DirtyVector.SizeOfBitMap / 8);
- RegistryHive->Free(RegistryHive->DirtyVector.Buffer);
+ if (RegistryHive->DirtyVector.SizeOfBitMap > 0)
+ {
+ ASSERT(RegistryHive->DirtyVector.Buffer);
+ RtlCopyMemory(BitmapBuffer,
+ RegistryHive->DirtyVector.Buffer,
+ RegistryHive->DirtyVector.SizeOfBitMap / 8);
+ RegistryHive->Free(RegistryHive->DirtyVector.Buffer);
+ }
RtlInitializeBitMap(&RegistryHive->DirtyVector, BitmapBuffer,
BitmapSize * 8);
}