]> git.proxmox.com Git - zfs-grub.git/blame - pvepatches/biosdisk-Add-missing-cast.patch
use latest packages from githup (2.02-beta2.9-ZOL11-7aa9f6)
[zfs-grub.git] / pvepatches / biosdisk-Add-missing-cast.patch
CommitLineData
0a671b56
DM
1From d1130afa5f22e4fee75ab55f11e16e0fbd98597d Mon Sep 17 00:00:00 2001
2From: Vladimir Serbinenko <phcoder@gmail.com>
3Date: Sat, 24 Jan 2015 20:50:30 +0000
4Subject: biosdisk: Add missing cast.
5
6Found by: Coverity scan.
7---
8diff --git a/grub-core/disk/i386/pc/biosdisk.c b/grub-core/disk/i386/pc/biosdisk.c
9index 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--
33cgit v0.9.0.2