Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern add some (uint64_t) casts so avoid 32 bit overflows...
details: https://anonhg.NetBSD.org/src/rev/e128a3ee977f
branches: trunk
changeset: 758014:e128a3ee977f
user: mrg <mrg%NetBSD.org@localhost>
date: Thu Oct 14 00:47:16 2010 +0000
description:
add some (uint64_t) casts so avoid 32 bit overflows. this fixes my
3TB disk with 4KB sectors and disklabel (which looks like it would
work upto 16TB.)
idea from mlelstv@.
diffstat:
sys/kern/subr_disk.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diffs (29 lines):
diff -r 3f042d879a6e -r e128a3ee977f sys/kern/subr_disk.c
--- a/sys/kern/subr_disk.c Wed Oct 13 14:34:27 2010 +0000
+++ b/sys/kern/subr_disk.c Thu Oct 14 00:47:16 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_disk.c,v 1.99 2009/11/28 22:38:07 dsl Exp $ */
+/* $NetBSD: subr_disk.c,v 1.100 2010/10/14 00:47:16 mrg Exp $ */
/*-
* Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.99 2009/11/28 22:38:07 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.100 2010/10/14 00:47:16 mrg Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -363,8 +363,8 @@
return -1;
}
- p_size = p->p_size << dk->dk_blkshift;
- p_offset = p->p_offset << dk->dk_blkshift;
+ p_size = (uint64_t)p->p_size << dk->dk_blkshift;
+ p_offset = (uint64_t)p->p_offset << dk->dk_blkshift;
#if RAW_PART == 3
labelsector = lp->d_partitions[2].p_offset;
#else
Home |
Main Index |
Thread Index |
Old Index