]> git.proxmox.com Git - zfs-grub.git/blob - pvepatches/biosdisk-Add-missing-cast.patch
96315d05f6f02e23d0b8878ff55b6a3ea78eb2c6
[zfs-grub.git] / pvepatches / biosdisk-Add-missing-cast.patch
1 From d1130afa5f22e4fee75ab55f11e16e0fbd98597d Mon Sep 17 00:00:00 2001
2 From: Vladimir Serbinenko <phcoder@gmail.com>
3 Date: Sat, 24 Jan 2015 20:50:30 +0000
4 Subject: biosdisk: Add missing cast.
5
6 Found by: Coverity scan.
7 ---
8 diff --git a/grub-core/disk/i386/pc/biosdisk.c b/grub-core/disk/i386/pc/biosdisk.c
9 index 26a4973..f0aadd1 100644
10 --- a/grub-core/disk/i386/pc/biosdisk.c
11 +++ b/grub-core/disk/i386/pc/biosdisk.c
12 @@ -382,7 +382,8 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
13 /* Some buggy BIOSes doesn't return the total sectors
14 correctly but returns zero. So if it is zero, compute
15 it by C/H/S returned by the LBA BIOS call. */
16 - total_sectors = drp->cylinders * drp->heads * drp->sectors;
17 + total_sectors = ((grub_uint64_t) drp->cylinders)
18 + * drp->heads * drp->sectors;
19 if (drp->bytes_per_sector
20 && !(drp->bytes_per_sector & (drp->bytes_per_sector - 1))
21 && drp->bytes_per_sector >= 512
22 @@ -425,7 +426,8 @@ grub_biosdisk_open (const char *name, grub_disk_t disk)
23 data->heads = 255;
24
25 if (! total_sectors)
26 - total_sectors = data->cylinders * data->heads * data->sectors;
27 + total_sectors = ((grub_uint64_t) data->cylinders)
28 + * data->heads * data->sectors;
29 }
30
31 disk->total_sectors = total_sectors;
32 --
33 cgit v0.9.0.2