Fix potentially overflowing expression "fs->fs_ipg * fs->fs_ncg"

by casting fs->fs_ipg to (ino_t).

CID: 1388258
This commit is contained in:
Kirk McKusick 2018-04-11 19:28:54 +00:00
parent 621cbb9437
commit 6986f98fc2

View File

@ -60,7 +60,7 @@ getino(struct uufsd *disk, void **dino, ino_t inode, int *mode)
ERROR(disk, NULL);
fs = &disk->d_fs;
if (inode >= fs->fs_ipg * fs->fs_ncg) {
if (inode >= (ino_t)fs->fs_ipg * fs->fs_ncg) {
ERROR(disk, "inode number out of range");
return (-1);
}