From 5c8a6f63b2283d12c77e308008ca0689fa58895e Mon Sep 17 00:00:00 2001 From: Maxim Sobolev Date: Tue, 29 Nov 2005 03:03:34 +0000 Subject: [PATCH] Check value returned by g_read_data(9), otherwise we can end in panic(9) if read error happens. MFC after: 1 week --- sys/geom/label/g_label_ntfs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/geom/label/g_label_ntfs.c b/sys/geom/label/g_label_ntfs.c index a16cca224516..d3722e85a0e1 100644 --- a/sys/geom/label/g_label_ntfs.c +++ b/sys/geom/label/g_label_ntfs.c @@ -74,6 +74,9 @@ g_label_ntfs_taste(struct g_consumer *cp, char *label, size_t size) goto done; filerecp = g_read_data(cp, voloff, recsize, &error); + if (filerecp == NULL) + goto done; + fr = (struct filerec *)filerecp; if(fr->fr_fixup.fh_magic != NTFS_FILEMAGIC){