Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 May 2011 11:20:27 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221645 - head/sys/geom/part
Message-ID:  <201105081120.p48BKRB7043544@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Sun May  8 11:20:27 2011
New Revision: 221645
URL: http://svn.freebsd.org/changeset/base/221645

Log:
  Limit number of sectors that can be addressed.
  
  MFC after:	1 week

Modified:
  head/sys/geom/part/g_part_pc98.c

Modified: head/sys/geom/part/g_part_pc98.c
==============================================================================
--- head/sys/geom/part/g_part_pc98.c	Sun May  8 11:16:17 2011	(r221644)
+++ head/sys/geom/part/g_part_pc98.c	Sun May  8 11:20:27 2011	(r221645)
@@ -261,7 +261,7 @@ g_part_pc98_create(struct g_part_table *
 
 	cyl = basetable->gpt_heads * basetable->gpt_sectors;
 
-	msize = MIN(pp->mediasize / SECSIZE, 0xffffffff);
+	msize = MIN(pp->mediasize / SECSIZE, UINT_MAX);
 	basetable->gpt_first = cyl;
 	basetable->gpt_last = msize - (msize % cyl) - 1;
 
@@ -451,7 +451,7 @@ g_part_pc98_read(struct g_part_table *ba
 
 	pp = cp->provider;
 	table = (struct g_part_pc98_table *)basetable;
-	msize = pp->mediasize / SECSIZE;
+	msize = MIN(pp->mediasize / SECSIZE, UINT_MAX);
 
 	buf = g_read_data(cp, 0L, BOOTSIZE, &error);
 	if (buf == NULL)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105081120.p48BKRB7043544>