From b465f05ed63a7c310182aa0a32cd29b0e02103a0 Mon Sep 17 00:00:00 2001 From: Glenn Burkhardt Date: Mon, 30 Jun 2003 18:58:07 +0000 Subject: [PATCH] fix bug #1393, "sortm core dumps", using patch provided by Robert Elz, kre@munnari.oz.au. The core dump occurred when "Subject:" was immediately followed by an alphanumeric, and "-textfield subject" were used as arguments. --- uip/sortm.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/uip/sortm.c b/uip/sortm.c index 5cff943..8f9bf81 100644 --- a/uip/sortm.c +++ b/uip/sortm.c @@ -443,24 +443,23 @@ get_fields (char *datesw, int msg, struct smsg *smsg) cp = subjcomp; cp2 = subjcomp; - if (strcmp (subjsort, "subject") == 0) + if (strcmp (subjsort, "subject") == 0) { while ((c = *cp)) { if (! isspace(c)) { if(uprf(cp, "re:")) cp += 2; - else { - if (isalnum(c)) - *cp2++ = isupper(c) ? tolower(c) : c; + else break; - } } cp++; } + } + while ((c = *cp++)) { if (isalnum(c)) *cp2++ = isupper(c) ? tolower(c) : c; - } + *cp2 = '\0'; } else -- 1.7.10.4