Limit number of sectors that can be addressed.

MFC after:	1 week
This commit is contained in:
Andrey V. Elsukov 2011-05-08 11:20:27 +00:00
parent cfbdf6c3c5
commit ab0ffb4c88
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=221645

View File

@ -261,7 +261,7 @@ g_part_pc98_create(struct g_part_table *basetable, struct g_part_parms *gpp)
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 *basetable, struct g_consumer *cp)
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)