Cast the partial result of an expression to an off_t to fix an overflow

in the calculation of free disk space. Fixes PR#1569.

Submitted by:	Tor Egge <Tor.Egge@idt.ntnu.no>
This commit is contained in:
David Greenman 1996-09-05 08:08:41 +00:00
parent 0247363f69
commit 0bade8bdd8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18042

View File

@ -548,7 +548,7 @@ check_space()
syslog(LOG_ERR, "%s: %m", dirname);
exit(1);
}
spacefree = (fsbuf.f_bavail * fsbuf.f_bsize) / 1024;
spacefree = ((off_t) fsbuf.f_bavail * fsbuf.f_bsize) / 1024;
(void)snprintf(path, sizeof(path), "%s/minfree", dirname);
if ((fp = fopen(path, "r")) == NULL)