aboutsummaryrefslogtreecommitdiff
path: root/sbin/bsdlabel
diff options
context:
space:
mode:
authorYaroslav Tykhiy <ytykhiy@gmail.com>2003-04-01 14:44:53 +0000
committerYaroslav Tykhiy <ytykhiy@gmail.com>2003-04-01 14:44:53 +0000
commit29f3f095a624492078f7578be83d684fc32fb2a9 (patch)
treef5ca406d4d3c1bafa269c9e39d73deab0979c217 /sbin/bsdlabel
parent51a5b7f1ba969e576ae4da656f60db9ed2527fc1 (diff)
downloadsrc-29f3f095a624492078f7578be83d684fc32fb2a9.tar.gz
src-29f3f095a624492078f7578be83d684fc32fb2a9.zip
Don't die of SIGSEGV on a missing fstype field
in a saved disklabel file. MFC after: 1 week
Notes
Notes: svn path=/head/; revision=112945
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 49ada3cab60f..a6477fad6a8f 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))