From baa15be0ead80bcb6a55ca7b6a4dbcd77bab77b7 Mon Sep 17 00:00:00 2001 From: David Schultz Date: Mon, 17 Dec 2007 08:03:18 +0000 Subject: [PATCH] Fix an int overflow on very large file systems. PR: bin/113399 Submitted by: Staffan Ulfberg --- sbin/growfs/growfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c index dab9ba76a887..89b14dac27f6 100644 --- a/sbin/growfs/growfs.c +++ b/sbin/growfs/growfs.c @@ -259,8 +259,8 @@ growfs(int fsi, int fso, unsigned int Nflag) */ for (cylno = osblock.fs_ncg; cylno < sblock.fs_ncg; cylno++) { initcg(cylno, utime, fso, Nflag); - j = sprintf(tmpbuf, " %d%s", - (int)fsbtodb(&sblock, cgsblock(&sblock, cylno)), + j = sprintf(tmpbuf, " %jd%s", + (intmax_t)fsbtodb(&sblock, cgsblock(&sblock, cylno)), cylno < (sblock.fs_ncg-1) ? "," : "" ); if (i + j >= width) { printf("\n");