From d1130afa5f22e4fee75ab55f11e16e0fbd98597d Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Sat, 24 Jan 2015 21:50:30 +0100
Subject: [PATCH 204/506] biosdisk: Add missing cast.
Found by: Coverity scan.
---
grub-core/disk/i386/pc/biosdisk.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/grub-core/disk/i386/pc/biosdisk.c b/grub-core/disk/i386/pc/biosdisk.c
index 26a4973..f0aadd1 100644
--- a/grub-core/disk/i386/pc/biosdisk.c
+++ b/grub-core/disk/i386/pc/biosdisk.c
@@ -382,7 +382,8 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
/* Some buggy BIOSes doesn't return the total sectors
correctly but returns zero. So if it is zero, compute
it by C/H/S returned by the LBA BIOS call. */
- total_sectors = drp->cylinders * drp->heads * drp->sectors;
+ total_sectors = ((grub_uint64_t) drp->cylinders)
+ * drp->heads * drp->sectors;
if (drp->bytes_per_sector
&& !(drp->bytes_per_sector & (drp->bytes_per_sector - 1))
&& drp->bytes_per_sector >= 512
@@ -425,7 +426,8 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
data->heads = 255;
if (! total_sectors)
- total_sectors = data->cylinders * data->heads * data->sectors;
+ total_sectors = ((grub_uint64_t) data->cylinders)
+ * data->heads * data->sectors;
}
disk->total_sectors = total_sectors;
--
2.4.3