diff options
author | yar <yar@FreeBSD.org> | 2003-04-01 14:44:53 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2003-04-01 14:44:53 +0000 |
commit | 98acc8a3d79206dbf51e83ae8573fa89e54645b6 (patch) | |
tree | f5ca406d4d3c1bafa269c9e39d73deab0979c217 /sbin/bsdlabel/bsdlabel.c | |
parent | 78452f5f28ad0960d69047f69be9ef1b01991a6a (diff) | |
download | FreeBSD-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/bsdlabel.c')
-rw-r--r-- | sbin/bsdlabel/bsdlabel.c | 4 |
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)) |