Limit number of sectors that can be addressed.
MFC after: 1 week
This commit is contained in:
parent
b64a692b64
commit
cfbdf6c3c5
@ -262,7 +262,7 @@ g_part_mbr_create(struct g_part_table *basetable, struct g_part_parms *gpp)
|
||||
if (pp->sectorsize < MBRSIZE)
|
||||
return (ENOSPC);
|
||||
|
||||
msize = MIN(pp->mediasize / pp->sectorsize, 0xffffffff);
|
||||
msize = MIN(pp->mediasize / pp->sectorsize, UINT_MAX);
|
||||
basetable->gpt_first = basetable->gpt_sectors;
|
||||
basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1;
|
||||
|
||||
@ -433,7 +433,7 @@ g_part_mbr_read(struct g_part_table *basetable, struct g_consumer *cp)
|
||||
|
||||
pp = cp->provider;
|
||||
table = (struct g_part_mbr_table *)basetable;
|
||||
msize = pp->mediasize / pp->sectorsize;
|
||||
msize = MIN(pp->mediasize / pp->sectorsize, UINT_MAX);
|
||||
|
||||
buf = g_read_data(cp, 0L, pp->sectorsize, &error);
|
||||
if (buf == NULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user