From d5c4918a7c3b1637042bbdab36e55a2985aaf440 Mon Sep 17 00:00:00 2001 From: Antonio Huete Jimenez Date: Tue, 3 Sep 2013 14:02:00 +0200 Subject: [PATCH] disklabel64 - Increased verification of the partition format. * Check whether the filesystem type is specified when formatting partitions. Specifying: a: * 0 would cause a SEGFAULT due the filesystem field not being present. Fix has been taken from disklabel32. --- sbin/disklabel64/disklabel64.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sbin/disklabel64/disklabel64.c b/sbin/disklabel64/disklabel64.c index f8fecaa543..afd77ec1b1 100644 --- a/sbin/disklabel64/disklabel64.c +++ b/sbin/disklabel64/disklabel64.c @@ -1163,6 +1163,11 @@ getasciipartspec(char *tp, struct disklabel64 *lp, int part, /* * fstype */ + if (tp == NULL) { + fprintf(stderr, + "line %d: no filesystem type was specified\n", lineno); + return(1); + } cp = tp; tp = word(cp); for (cpp = fstypenames; cpp < &fstypenames[FSMAXTYPES]; cpp++) { -- 2.41.0