summaryrefslogtreecommitdiffstats
path: root/sbin/bsdlabel
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2003-04-01 14:44:53 +0000
committeryar <yar@FreeBSD.org>2003-04-01 14:44:53 +0000
commit98acc8a3d79206dbf51e83ae8573fa89e54645b6 (patch)
treef5ca406d4d3c1bafa269c9e39d73deab0979c217 /sbin/bsdlabel
parent78452f5f28ad0960d69047f69be9ef1b01991a6a (diff)
downloadFreeBSD-src-98acc8a3d79206dbf51e83ae8573fa89e54645b6.zip
FreeBSD-src-98acc8a3d79206dbf51e83ae8573fa89e54645b6.tar.gz
Don't die of SIGSEGV on a missing fstype field
in a saved disklabel file. MFC after: 1 week
Diffstat (limited to 'sbin/bsdlabel')
-rw-r--r--sbin/bsdlabel/bsdlabel.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index 49ada3c..a6477fa 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -1134,6 +1134,10 @@ getasciipartspec(char *tp, struct disklabel *lp, int part, int lineno)
return (1);
}
pp->p_offset = v;
+ if (tp == NULL) {
+ fprintf(stderr, "line %d: missing file system type\n", lineno);
+ return (1);
+ }
cp = tp, tp = word(cp);
for (cpp = fstypenames; cpp < &fstypenames[FSMAXTYPES]; cpp++)
if (*cpp && streq(*cpp, cp))
OpenPOWER on IntegriCloud