NetBSD Problem Report #18664

Received: (qmail 15221 invoked by uid 605); 15 Oct 2002 08:43:31 -0000
Message-Id: <200210150841.g9F8fbi15819@delta.cs.mu.OZ.AU>
Date: Tue, 15 Oct 2002 15:41:37 +0700 (ICT)
From: kre@munnari.OZ.AU
Sender: gnats-bugs-owner@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: nmh sortm core dump
X-Send-Pr-Version: 3.95

>Number:         18664
>Category:       pkg
>Synopsis:       nmh sortm core dump
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    agc
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 15 08:44:01 +0000 2002
>Closed-Date:    Tue Oct 15 10:49:43 +0000 2002
>Last-Modified:  Tue Oct 15 10:49:43 +0000 2002
>Originator:     Robert Elz
>Release:        NetBSD 1.5ZC (current pkgsrc of 20021014)
>Organization:
	Prince of Songkla University
>Environment:


System: NetBSD delta.cs.mu.OZ.AU 1.5ZC NetBSD 1.5ZC (DELTA) #4: Mon May 27 23:17:55 ICT 2002 kre@delta.cs.mu.OZ.AU:/usr/src/sys.X/arch/i386/compile/DELTA i386
Architecture: i386
Machine: i386
>Description:
	A bug report (from Scott Lipcon) was submitted elsewhere:
http://savannah.nongnu.org/bugs/?func=detailbug&bug_id=1393&group_id=2166
	and then today copied to the nmh-workers list.

	Basically, using "sortm -textfield subject" where a message
	in the folder contains "Subject:N" where "N" is alphanumeric
	will cause sortm to dump core (the "korean spam" aspect of the
	mail that caused the original bug report is irrelevant).

>How-To-Repeat:
	Use nmh.   Put a message in a folder that contains "Subject:1234"
	and then run
		sortm +whatever-folder -textfield subject
	and watch for the core dump.

	Or, examine the code and be amazed ...
>Fix:

Here's a patch, I stuck it in patches/patch-ce (though the naming
convention for patches is beyond my comprehension).   And yes, this
really does add a preprocessor conditional that makes either one of
two original statements get compiled, and the other omitted (ie: the
patch is correct, though just deleting a line would work as well).
The "#if 0" could become "#if 1" and the core dump would also be gone,
though the results of the sort would then sometimes be rather hard to
explain...

If we're quick, NetBSD can be the first OS to include a patch for
this (I did already send the same patch to nmh-workers, though I have
no reason to believe it will achieve a lot there).

--- uip/sortm.c.WAS	Tue Oct 15 15:18:47 2002
+++ uip/sortm.c	Tue Oct 15 15:20:11 2002
@@ -439,9 +439,12 @@
 			if(uprf(cp, "re:"))
 			    cp += 2;
 			else {
+#if 0
 			    if (isalnum(c))
 				*cp2++ = isupper(c) ? tolower(c) : c;
+#else
 			    break;
+#endif
 			}
 		    }
 		    cp++;
>Release-Note:
>Audit-Trail:

From: "Alistair G. Crooks" <agc@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pr/18664 CVS commit: pkgsrc/mail/nmh
Date: Tue, 15 Oct 2002 13:47:01 +0300 (EEST)

 Module Name:	pkgsrc
 Committed By:	agc
 Date:		Tue Oct 15 10:47:01 UTC 2002

 Modified Files:
 	pkgsrc/mail/nmh: Makefile distinfo
 Added Files:
 	pkgsrc/mail/nmh/patches: patch-ce

 Log Message:
 Fix from Robert Elz in PR 18664 to stop sortm coredumping when there's
 a numerical subject.

 "And yes, this really does add a preprocessor conditional that makes
 either one of two original statements get compiled, and the other
 omitted (ie:  the patch is correct, though just deleting a line would
 work as well).  The "#if 0" could become "#if 1" and the core dump
 would also be gone, though the results of the sort would then
 sometimes be rather hard to explain..."

 Bump PKGREVISION.


 To generate a diff of this commit:
 cvs rdiff -r1.47 -r1.48 pkgsrc/mail/nmh/Makefile
 cvs rdiff -r1.4 -r1.5 pkgsrc/mail/nmh/distinfo
 cvs rdiff -r0 -r1.3 pkgsrc/mail/nmh/patches/patch-ce

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: "Alistair G. Crooks" <agc@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pr/18664 CVS commit: pkgsrc/doc
Date: Tue, 15 Oct 2002 13:48:27 +0300 (EEST)

 Module Name:	pkgsrc
 Committed By:	agc
 Date:		Tue Oct 15 10:48:27 UTC 2002

 Modified Files:
 	pkgsrc/doc: CHANGES

 Log Message:
 Fix from Robert Elz in PR 18664 to stop sortm coredumping when there's
 a numerical subject.

 "And yes, this really does add a preprocessor conditional that makes
 either one of two original statements get compiled, and the other
 omitted (ie:  the patch is correct, though just deleting a line would
 work as well).  The "#if 0" could become "#if 1" and the core dump
 would also be gone, though the results of the sort would then
 sometimes be rather hard to explain..."

 Bump PKGREVISION.


 To generate a diff of this commit:
 cvs rdiff -r1.257 -r1.258 pkgsrc/doc/CHANGES

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed 
State-Changed-By: agc 
State-Changed-When: Tue Oct 15 03:49:00 PDT 2002 
State-Changed-Why:  
agc applied the fix given in the PR - thanks for that. 


Responsible-Changed-From-To: pkg-manager->agc 
Responsible-Changed-By: agc 
Responsible-Changed-When: Tue Oct 15 03:49:00 PDT 2002 
Responsible-Changed-Why:  
agc took responsibility for this one. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.