Subject: bin/24832: sushi(8) form data is limited to 80 characters
To: None <gnats-bugs@gnats.NetBSD.org>
From: Peter Postma <peter@pointless.nl>
List: netbsd-bugs
Date: 03/17/2004 21:38:42
>Number:         24832
>Category:       bin
>Synopsis:       sushi(8) form data is limited to 80 characters
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 17 20:39:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Peter Postma
>Release:        NetBSD 1.6ZK
>Organization:
>Environment:
System: NetBSD mercury.pointless.nl 1.6ZK NetBSD 1.6ZK (mercury) #27: Sat Mar 13 14:35:22 CET 2004 peter@mercury.pointless.nl:/usr/obj/sys/arch/sparc64/compile/mercury sparc64
Architecture: sparc64
Machine: sparc64
>Description:
	The data for each field in the form files is limited to 80 characters.

>How-To-Repeat:
	Add a list in a form file which has more than 80 characters, e.g.:

	list:adosfs,cd9660,ext2fs,fdesc,ffs,filecore,kernfs,lfs,mfs,msdos,nfs,ntfs,null,overlay,portal,procfs,swap,umap,union		Filesytem type

	The list will be truncated.

>Fix:
	Patch below should solve the issue.

Index: scanform.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/sushi/scanform.c,v
retrieving revision 1.34
diff -u -r1.34 scanform.c
--- scanform.c	10 Mar 2004 19:03:16 -0000	1.34
+++ scanform.c	17 Mar 2004 20:28:11 -0000
@@ -155,7 +155,6 @@
 	char *x;
 	char desc[80];
 	int type;
-	char data[80];
 	int req = 0;
 
 	while (*++t && !isspace((unsigned char)*t));
@@ -233,8 +232,6 @@
 		bailout("%s: %s",
 		    catgets(catalog, 1, 11, "invalid data type"), x);
 
-	snprintf(data, (size_t)(t-row+1), "%s", row);
-
 	while (*++t && isspace((unsigned char)*t));
 	if (strlen(t) > 50)
 		bailout(catgets(catalog, 1, 12, "description too long"));
@@ -243,7 +240,7 @@
 	if (strcmp(desc, "BLANK") == 0)
 		snprintf(desc, sizeof(desc), " ");
 
-	form_appenditem(cqf, desc, type, data, req);
+	form_appenditem(cqf, desc, type, row, req);
 }
 
 int
>Release-Note:
>Audit-Trail:
>Unformatted: