diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-07-17 12:40:01 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-07-17 12:40:01 -0700 |
commit | 9c2baed55c657e68b5d2aa7de7557eccfc74eb6b (patch) | |
tree | addecbba0805d9e417ae8a3608571a91f9779ce3 /core | |
parent | 8cca6fd29bb7613f5ba6acb1b740d13f5b6ac01d (diff) | |
download | syslinux-9c2baed55c657e68b5d2aa7de7557eccfc74eb6b.tar.gz |
diskio: add a paranoia cast
Make sure we don't overflow the shift, even though that should never
be possible.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core')
-rw-r--r-- | core/fs/diskio.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/fs/diskio.c b/core/fs/diskio.c index 449e12c4..481b59b0 100644 --- a/core/fs/diskio.c +++ b/core/fs/diskio.c @@ -12,7 +12,7 @@ static inline sector_t chs_max(const struct disk *disk) { - return disk->secpercyl << 10; + return (sector_t)disk->secpercyl << 10; } static int chs_rdwr_sectors(struct disk *disk, void *buf, |