fsck_msdosfs: check next cluster index for validity before using it
authorSimon Schubert <corecode@dragonflybsd.org>
Wed, 18 Feb 2009 10:57:53 +0000 (11:57 +0100)
committerSimon Schubert <corecode@dragonflybsd.org>
Wed, 18 Feb 2009 11:01:27 +0000 (12:01 +0100)
commit62d33a05b33e52cac8d86a93b81df3c5698f0c5f
tree28f621a60a5ae37cfd72a2c50341e4ab23489374
parenta385a915f535c34f7308c5bbf1f168b43353db68
fsck_msdosfs: check next cluster index for validity before using it

The boot->FSNext index can wind up to be out of range, thus leading to a
segfault when trying to check whether it is pointing to a free cluster.
Check for it being in range before using it as an index into the fat
array.
sbin/fsck_msdosfs/fat.c