[DISK]
authorPierre Schweitzer <pierre@reactos.org>
Thu, 3 Nov 2016 21:38:56 +0000 (21:38 +0000)
committerPierre Schweitzer <pierre@reactos.org>
Thu, 3 Nov 2016 21:38:56 +0000 (21:38 +0000)
Don't overflow when computing disk size.
Patch by Vort.

CORE-12261

svn path=/trunk/; revision=73113

reactos/drivers/storage/class/disk/disk.c

index f042031..0563702 100644 (file)
@@ -4283,7 +4283,7 @@ diskMatched:
     DeviceExtension->DiskGeometry->Geometry.SectorsPerTrack = sectorsPerTrack;
     DeviceExtension->DiskGeometry->Geometry.TracksPerCylinder = tracksPerCylinder;
     DeviceExtension->DiskGeometry->Geometry.Cylinders.QuadPart = (LONGLONG)cylinders;
     DeviceExtension->DiskGeometry->Geometry.SectorsPerTrack = sectorsPerTrack;
     DeviceExtension->DiskGeometry->Geometry.TracksPerCylinder = tracksPerCylinder;
     DeviceExtension->DiskGeometry->Geometry.Cylinders.QuadPart = (LONGLONG)cylinders;
-    DeviceExtension->DiskGeometry->DiskSize.QuadPart = cylinders * tracksPerCylinder * sectorsPerTrack *
+    DeviceExtension->DiskGeometry->DiskSize.QuadPart = (LONGLONG)cylinders * tracksPerCylinder * sectorsPerTrack *
                                                        DeviceExtension->DiskGeometry->Geometry.BytesPerSector;
 
     DebugPrint((3,
                                                        DeviceExtension->DiskGeometry->Geometry.BytesPerSector;
 
     DebugPrint((3,