From 869ef8b48ce2c3c21ab1e23f1f738e309b2f2dbb Mon Sep 17 00:00:00 2001 From: jwd Date: Tue, 24 Oct 2000 03:28:59 +0000 Subject: [PATCH] Cast block number to off_t to avoid possible overflow bugs. Pointed out by: Bruce Evans --- sbin/newfs/mkfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 8e1931e41c3d..7e5ea14dedde 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -1380,7 +1380,7 @@ wtfs(bno, size, bf) return; done = 1; } - if (wc_sect * sectorsize + wc_end == bno * sectorsize && + if ((off_t)wc_sect * sectorsize + wc_end == (off_t)bno * sectorsize && wc_end + size <= WCSIZE) { bcopy(bf, wc + wc_end, size); wc_end += size;