a uint64_t may not produce the (humanly) obvious result.
Cast one of them to a (uint64_t) in the hope of invoking the
appropriate int promotion god.
CID
1519495
-/* $OpenBSD: subr_disk.c,v 1.250 2022/08/11 20:22:27 krw Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.251 2022/08/12 00:32:59 krw Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
partnum = letoh32(gh->gh_part_num);
partsize = letoh32(gh->gh_part_size);
- sectors = (partnum * partsize + lp->d_secsize - 1) / lp->d_secsize;
+ sectors = ((uint64_t)partnum * partsize + lp->d_secsize - 1) /
+ lp->d_secsize;
ngp = mallocarray(sectors, lp->d_secsize, M_DEVBUF, M_NOWAIT | M_ZERO);
if (ngp == NULL) {