svn commit: r298518 - head/sys/fs/ext2fs

Pedro F. Giffuni pfg at FreeBSD.org
Sat Apr 23 18:29:00 UTC 2016


Author: pfg
Date: Sat Apr 23 18:28:59 2016
New Revision: 298518
URL: https://svnweb.freebsd.org/changeset/base/298518

Log:
  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:
  head/sys/fs/ext2fs/ext2_htree.c

Modified: head/sys/fs/ext2fs/ext2_htree.c
==============================================================================
--- head/sys/fs/ext2fs/ext2_htree.c	Sat Apr 23 17:09:40 2016	(r298517)
+++ head/sys/fs/ext2fs/ext2_htree.c	Sat Apr 23 18:28:59 2016	(r298518)
@@ -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;


More information about the svn-src-head mailing list