summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-04-23 18:28:59 +0000
committerpfg <pfg@FreeBSD.org>2016-04-23 18:28:59 +0000
commit70b5d1597004b54a0bf784a23f81745ba1819934 (patch)
treedc28c042223a683e9c4dceed31bfc685b26b2f86
parent7f99321646fa24a0599c6c2f425142bb90e92ed9 (diff)
downloadFreeBSD-src-70b5d1597004b54a0bf784a23f81745ba1819934.zip
FreeBSD-src-70b5d1597004b54a0bf784a23f81745ba1819934.tar.gz
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
-rw-r--r--sys/fs/ext2fs/ext2_htree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/ext2fs/ext2_htree.c b/sys/fs/ext2fs/ext2_htree.c
index a109224..6505e05 100644
--- a/sys/fs/ext2fs/ext2_htree.c
+++ b/sys/fs/ext2fs/ext2_htree.c
@@ -191,7 +191,7 @@ ext2_htree_set_limit(struct ext2fs_htree_entry *ep, uint16_t limit)
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;
OpenPOWER on IntegriCloud