Fix CID 1204379 (vtoc8.c) & CID 1204380 (bsd.c): Cast ncyls to lba_t
before multiplying the 32-bit integrals to avoid any possibility of truncation before widening. Not a likely scenario to begin with...
This commit is contained in:
parent
92a68a8501
commit
12d9d80011
@ -80,7 +80,7 @@ bsd_write(lba_t imgsz, void *bootcode)
|
||||
} else
|
||||
memset(buf, 0, BBSIZE);
|
||||
|
||||
imgsz = ncyls * nheads * nsecs;
|
||||
imgsz = (lba_t)ncyls * nheads * nsecs;
|
||||
error = image_set_size(imgsz);
|
||||
if (error) {
|
||||
free(buf);
|
||||
|
@ -71,7 +71,7 @@ vtoc8_write(lba_t imgsz, void *bootcode __unused)
|
||||
int error, n;
|
||||
uint16_t ofs, sum;
|
||||
|
||||
imgsz = ncyls * nheads * nsecs;
|
||||
imgsz = (lba_t)ncyls * nheads * nsecs;
|
||||
|
||||
memset(&vtoc8, 0, sizeof(vtoc8));
|
||||
sprintf(vtoc8.ascii, "FreeBSD%lldM",
|
||||
|
Loading…
Reference in New Issue
Block a user