Subject: pkg/13528: chord crashes if a chord name is defined with a name longer than 9 bytes
To: None <gnats-bugs@gnats.netbsd.org>
From: maximum entropy <entropy@tappedin.com>
List: netbsd-bugs
Date: 07/21/2001 19:32:47
>Number:         13528
>Category:       pkg
>Synopsis:       chord crashes if a chord name is defined with a name longer than 9 bytes
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 21 16:30:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     maximum entropy
>Release:        <NetBSD-current source date>20010721
>Organization:
entropy -- it's not just a good idea, it's the second law.
>Environment:
	
System: NetBSD zippy.local 1.5W NetBSD 1.5W (ZIPPY) #2: Tue Jul 17 01:30:03 EDT 2001 entropy@zippy.local:/usr/src/sys/arch/i386/compile/ZIPPY i386
Architecture: i386
Machine: i386
>Description:
	

The "chord" program in pkgsrc will crash if a chord is defined with a name
longer than 9 bytes.

A common convention in "chord" is to append dots to a chord name to define
alternate fingerings.  So I have some chord names that are quite long in my
.chordrc and I have also encountered a few .crd files in the wild that define
long chord names.

>How-To-Repeat:
	

$ ed crash.crd
a
{define Asus4/Gb....... base-fret 7 frets x 3 1 1 x 0}
.
w
q
$ chord crash.crd > /dev/null
Segmentation fault (core dumped)

>Fix:
	

Add patches/patch-ab to increase CHORD_NAME_SZ to a much larger value:

Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/misc/chord/distinfo,v
retrieving revision 1.2
diff -u -u -r1.2 distinfo
--- distinfo	2001/04/20 13:52:09	1.2
+++ distinfo	2001/07/21 23:17:18
@@ -3,3 +3,4 @@
 SHA1 (chord.tar.gz) = 2d93a43ee153f840786d7218cf49b44c85d19388
 Size (chord.tar.gz) = 74809 bytes
 SHA1 (patch-aa) = 3af8a5e93e0c9c4f3dbf45cdc598daae96531509
+SHA1 (patch-ab) = d99fade958792cf1b31905d5b685b6cbfd699585
--- /dev/null	Sat Jul 21 19:15:06 2001
+++ patches/patch-ab	Sat Jul 21 19:17:01 2001
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- chord.h.orig	Tue Apr 25 03:04:47 1995
++++ chord.h	Sat Jul 21 19:09:19 2001
+@@ -11,7 +11,7 @@
+ #define MAXFONTS 16   /* Maximum number of different fonts in one execution */
+ #define MAXTOKEN 256
+ #define MAX_CHORD 1024
+-#define CHORD_NAME_SZ   10
++#define CHORD_NAME_SZ   100
+ #define MAXNOTE 8
+ 
+ #define LONG_FINGERS	4
>Release-Note:
>Audit-Trail:
>Unformatted: