Bug #1167

disklabel coredumps in the case you don't specify FS type

Added by ahuete.devel over 5 years ago. Updated over 5 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

Hi,

Seems that disklabel coredumps in the case you don't specify FS type on
a line when editing.

g: 1048576 14942208 4.2BSD # 512.000MB
h: 12288000 15990784 4.2BSD # 6000.000MB
i: * *
~
/tmp/EdDk.AtVvnxo30B: 30 lines, 806 characters.
Segmentation fault (core dumped)

Patch below fixes this issue:

Index: disklabel.c
===================================================================
RCS file: /home/dcvs/src/sbin/disklabel/disklabel.c,v
retrieving revision 1.27.2.1
diff -u -r1.27.2.1 disklabel.c
--- disklabel.c 16 Sep 2008 21:54:32 -0000 1.27.2.1
+++ disklabel.c 25 Nov 2008 19:25:13 -0000
@@ -1166,6 +1166,12 @@
/*
* fstype
*/
+ if (tp == NULL) {
+ fprintf(stderr,
+ "line %d: %s: no filesystem type was
specified\n" , lineno, cp);
+ return(1);
+ }
+
cp = tp;
tp = word(cp);
for (cpp = fstypenames; cpp < &fstypenames[FSMAXTYPES]; cpp++)

History

#1 Updated by nthery over 5 years ago

Patch slightly modified and committed. Thanks.

#2 Updated by aoiko over 5 years ago

committed by nth@

Also available in: Atom PDF