disklabel64 - Increased verification of the partition format.
authorAntonio Huete Jimenez <tuxillo@quantumachine.net>
Tue, 3 Sep 2013 12:02:00 +0000 (14:02 +0200)
committerAntonio Huete Jimenez <tuxillo@quantumachine.net>
Tue, 3 Sep 2013 13:17:26 +0000 (15:17 +0200)
* 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

index f8fecaa..afd77ec 100644 (file)
@@ -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++) {