Project

General

Profile

Actions

Bug #1167

closed

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

Added by ahuete.devel almost 16 years ago. Updated almost 16 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

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
+)

Actions #1

Updated by nthery almost 16 years ago

Patch slightly modified and committed. Thanks.

Actions #2

Updated by aoiko almost 16 years ago

committed by nth@

Actions

Also available in: Atom PDF