Fix integer overflow possibility.

Reported by:    Christopher Krah <krah@protonmail.com>
Reported as:    FS-2-EXT2-1: Out-of-Bounds Write in nmount (ext2_vget)
Reviewed by:    pfg
MFC after:      1 week

Differential Revision:    https://reviews.freebsd.org/D19326
This commit is contained in:
Fedor Uporov 2019-03-04 11:19:21 +00:00
parent 4ff6603ab3
commit 736da5176d

View File

@ -1163,8 +1163,8 @@ ext2_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp)
struct buf *bp;
struct vnode *vp;
struct thread *td;
int i, error;
int used_blocks;
unsigned int i, used_blocks;
int error;
td = curthread;
error = vfs_hash_get(mp, ino, flags, td, vpp, NULL, NULL);