svn commit: r248058 - head/sys/geom/label
Jean-Sebastien Pedron
dumbbell at FreeBSD.org
Fri Mar 8 18:07:44 UTC 2013
Author: dumbbell
Date: Fri Mar 8 18:07:43 2013
New Revision: 248058
URL: http://svnweb.freebsd.org/changeset/base/248058
Log:
g_label_ntfs_taste: Abort taste is recsize == 0
This will avoid a 0-byte read (in g_read_data()) leading to a panic, if
previously read data are erroneous.
Suggested by: John-Mark Gurney <jmg at funkthat.com>
Modified:
head/sys/geom/label/g_label_ntfs.c
Modified: head/sys/geom/label/g_label_ntfs.c
==============================================================================
--- head/sys/geom/label/g_label_ntfs.c Fri Mar 8 17:28:40 2013 (r248057)
+++ head/sys/geom/label/g_label_ntfs.c Fri Mar 8 18:07:43 2013 (r248058)
@@ -115,7 +115,7 @@ g_label_ntfs_taste(struct g_consumer *cp
mftrecsz = (char)bf->bf_mftrecsz;
recsize = (mftrecsz > 0) ? (mftrecsz * bf->bf_bps * bf->bf_spc) : (1 << -mftrecsz);
- if (recsize % pp->sectorsize != 0)
+ if (recsize == 0 || recsize % pp->sectorsize != 0)
goto done;
voloff = bf->bf_mftcn * bf->bf_spc * bf->bf_bps +
More information about the svn-src-head
mailing list