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:
parent
0247363f69
commit
0bade8bdd8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=18042
@ -548,7 +548,7 @@ check_space()
|
|||||||
syslog(LOG_ERR, "%s: %m", dirname);
|
syslog(LOG_ERR, "%s: %m", dirname);
|
||||||
exit(1);
|
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);
|
(void)snprintf(path, sizeof(path), "%s/minfree", dirname);
|
||||||
if ((fp = fopen(path, "r")) == NULL)
|
if ((fp = fopen(path, "r")) == NULL)
|
||||||
|
Loading…
Reference in New Issue
Block a user