diff options
author | takawata <takawata@FreeBSD.org> | 2005-10-26 03:24:28 +0000 |
---|---|---|
committer | takawata <takawata@FreeBSD.org> | 2005-10-26 03:24:28 +0000 |
commit | 3224e8b29a432cb906f9a21185ffda8334bc6bc7 (patch) | |
tree | 4873431bc0b0afc60884593632eb176de2484160 | |
parent | 52c3518dcc2286daa2fa3c504eb4e2e9bf4c536e (diff) | |
download | FreeBSD-src-3224e8b29a432cb906f9a21185ffda8334bc6bc7.zip FreeBSD-src-3224e8b29a432cb906f9a21185ffda8334bc6bc7.tar.gz |
Add checking for File record magic.
-rw-r--r-- | sys/geom/label/g_label_ntfs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/geom/label/g_label_ntfs.c b/sys/geom/label/g_label_ntfs.c index 5ec213f..a16cca2 100644 --- a/sys/geom/label/g_label_ntfs.c +++ b/sys/geom/label/g_label_ntfs.c @@ -75,6 +75,12 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) filerecp = g_read_data(cp, voloff, recsize, &error); fr = (struct filerec *)filerecp; + + if(fr->fr_fixup.fh_magic != NTFS_FILEMAGIC){ + label[0] = 0; + goto done; + } + for (ap = filerecp + fr->fr_attroff; atr = (struct attr *)ap, atr->a_hdr.a_type != -1; ap += atr->a_hdr.reclen) { if (atr->a_hdr.a_type == NTFS_A_VOLUMENAME) { if(atr->a_r.a_datalen >= size *2){ |