mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-28 03:42:04 +01:00
fs/msdosfs fatblock: use ulmin() rather than min()
to avoid truncation of pmp->pm_FATsecs. Submitted by: Robert Morris <rtm@lcs.mit.edu> PR: 277237 MFC after: 1 week
This commit is contained in:
parent
3db693f7da
commit
0085afdceb
@ -97,7 +97,7 @@ fatblock(struct msdosfsmount *pmp, u_long ofs, u_long *bnp, u_long *sizep,
|
||||
fatblocksec /= 2;
|
||||
}
|
||||
bn = ofs / pmp->pm_fatblocksize * pmp->pm_fatblocksec;
|
||||
size = roundup(min(fatblocksec, pmp->pm_FATsecs - bn) * DEV_BSIZE,
|
||||
size = roundup(ulmin(fatblocksec, pmp->pm_FATsecs - bn) * DEV_BSIZE,
|
||||
pmp->pm_BlkPerSec * DEV_BSIZE);
|
||||
bn += pmp->pm_fatblk + pmp->pm_curfat * pmp->pm_FATsecs;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user