[ACPI]
authorCameron Gutman <aicommander@gmail.com>
Tue, 16 Aug 2011 20:48:18 +0000 (20:48 +0000)
committerCameron Gutman <aicommander@gmail.com>
Tue, 16 Aug 2011 20:48:18 +0000 (20:48 +0000)
- Fix massive memory corruption during FDO device relations handling

svn path=/trunk/; revision=53272

reactos/drivers/bus/acpi/pnp.c

index 7151320..c59f30f 100644 (file)
@@ -193,7 +193,7 @@ Bus_FDO_PnP (
         //
 
         length = sizeof(DEVICE_RELATIONS) +
-                ((numPdosPresent + prevcount) * sizeof (PDEVICE_OBJECT)) -1;
+                (((numPdosPresent + prevcount) - 1) * sizeof (DEVICE_OBJECT));
 
         relations = (PDEVICE_RELATIONS) ExAllocatePoolWithTag (PagedPool,
                                         length, 'IPCA');
@@ -214,7 +214,7 @@ Bus_FDO_PnP (
         //
         if (prevcount) {
             RtlCopyMemory (relations->Objects, oldRelations->Objects,
-                                      prevcount * sizeof (PDEVICE_OBJECT));
+                                      prevcount * sizeof (DEVICE_OBJECT));
         }
 
         relations->Count = prevcount + numPdosPresent;