Subject: install/34791: installer can't enter fdisk partition ids in hex
To: None <install-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <dholland@eecs.harvard.edu>
List: netbsd-bugs
Date: 10/12/2006 02:05:00
>Number:         34791
>Category:       install
>Synopsis:       installer can't enter fdisk partition ids in hex
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    install-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 12 02:05:00 +0000 2006
>Originator:     David A. Holland
>Release:        NetBSD -current of 20061010
>Organization:
   Harvard EECS
>Environment:
System: NetBSD weatherwax 3.99.21 NetBSD 3.99.21 (WEATHERWAX) #1: Mon Jul 10 12:28:08 EDT 2006 dholland@weatherwax:/usr/src/sys/arch/i386/compile/WEATHERWAX i386
Architecture: i386
Machine: i386
>Description:
When installing, if you go to enter an fdisk partition type by number,
it accepts e.g. "0xa" but the buffer is too small to enter e.g. "0xaa".

>How-To-Repeat:
Install and partition for dual boot with an obscure OS, with a
reference list of partition type numbers that's printed in hex. :-)

>Fix:

(note that size 5 is sufficient, but 8 is round - if whoever reads
this feels that not allowing the entry of large numbers matters, go
with 5)

Index: distrib/utils/sysinst/mbr.c
===================================================================
RCS file: /cvsroot/src/distrib/utils/sysinst/mbr.c,v
retrieving revision 1.76
diff -u -r1.76 mbr.c
--- distrib/utils/sysinst/mbr.c	4 Oct 2006 21:27:28 -0000	1.76
+++ distrib/utils/sysinst/mbr.c	12 Oct 2006 01:57:55 -0000
@@ -331,7 +331,7 @@
 	int type;
 	u_int start, sz;
 	int i;
-	char numbuf[4];
+	char numbuf[8];
 
 	dump_mbr(ombri, "set type");