Date: Thu, 28 Apr 2016 01:05:41 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r298725 - stable/10/sys/fs/ext2fs Message-ID: <201604280105.u3S15fWv012550@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Thu Apr 28 01:05:40 2016 New Revision: 298725 URL: https://svnweb.freebsd.org/changeset/base/298725 Log: MFC r298518: ext2_htree_release(): prevent signed integer overflow in a loop. h_levels_num, as most data structs in ext2fs, is unsigned so the index that addresses it has to be unsigned as well. To get to overflow here we would probably be considering a degenerate case though. MFC after: 5 days Modified: stable/10/sys/fs/ext2fs/ext2_htree.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/ext2fs/ext2_htree.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_htree.c Wed Apr 27 23:04:42 2016 (r298724) +++ stable/10/sys/fs/ext2fs/ext2_htree.c Thu Apr 28 01:05:40 2016 (r298725) @@ -191,7 +191,7 @@ ext2_htree_set_limit(struct ext2fs_htree static void ext2_htree_release(struct ext2fs_htree_lookup_info *info) { - int i; + u_int i; for (i = 0; i < info->h_levels_num; i++) { struct buf *bp = info->h_levels[i].h_bp;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604280105.u3S15fWv012550>