Author: mckusick
Date: Wed Apr 11 19:28:54 2018
New Revision: 332415
URL: https://svnweb.freebsd.org/changeset/base/332415

Log:
  Fix potentially overflowing expression "fs->fs_ipg * fs->fs_ncg"
  by casting fs->fs_ipg to (ino_t).
  
  CID: 1388258

Modified:
  head/lib/libufs/inode.c

Modified: head/lib/libufs/inode.c
==============================================================================
--- head/lib/libufs/inode.c     Wed Apr 11 18:39:47 2018        (r332414)
+++ head/lib/libufs/inode.c     Wed Apr 11 19:28:54 2018        (r332415)
@@ -60,7 +60,7 @@ getino(struct uufsd *disk, void **dino, ino_t inode, i
        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);
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to