On Thu, May 03, 2007 at 03:37:51PM +0200, Aleksander Piotrowski wrote:
> There is 1.5.14 available, maybe this release has fixed this problem?

Actually, 1.5.15; it still has the bug.

BTW: Ray opened a ticket upstream including the (little bit improved)
patch. See also below.

ok?

Ciao,
        Kili


Index: snapshot/Makefile
===================================================================
RCS file: /cvs/ports/mail/mutt/snapshot/Makefile,v
retrieving revision 1.40
diff -u -p -r1.40 Makefile
--- snapshot/Makefile   2 Aug 2006 14:30:09 -0000       1.40
+++ snapshot/Makefile   3 May 2007 11:43:58 -0000
@@ -4,6 +4,7 @@ COMMENT=        "tty-based e-mail client, devel
 
 VERSION=       1.5.12
 DISTNAME=      mutt-${VERSION}
+PKGNAME=       ${DISTNAME}p0
 MASTER_SITES=  ${MASTER_SITES_MUTT:=devel/}
 
 FLAVORS=       hcache idn sidebar
Index: snapshot/patches/patch-muttlib_c
===================================================================
RCS file: snapshot/patches/patch-muttlib_c
diff -N snapshot/patches/patch-muttlib_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ snapshot/patches/patch-muttlib_c    3 May 2007 11:43:58 -0000
@@ -0,0 +1,26 @@
+$OpenBSD$
+
+--- muttlib.c.orig     Thu Jun  8 13:51:03 2006
++++ muttlib.c  Thu May  3 13:41:28 2007
+@@ -532,16 +532,19 @@ char *mutt_gecos_name (char *dest, size_t destlen, str
+ 
+   pwnl = strlen (pw->pw_name);
+ 
+-  for (idx = 0; dest[idx]; idx++)
++  for (idx = 0; dest[idx] && idx < destlen - 1; idx++)
+   {
+     if (dest[idx] == '&')
+     {
+-      memmove (&dest[idx + pwnl], &dest[idx + 1],
++      /* Don't move if destination is outside buffer. */
++      if (idx + pwnl < destlen)
++        memmove (&dest[idx + pwnl], &dest[idx + 1],
+              MAX(destlen - idx - pwnl - 1, 0));
+       memcpy (&dest[idx], pw->pw_name, MIN(destlen - idx - 1, pwnl));
+       dest[idx] = toupper ((unsigned char) dest[idx]);
+     }
+   }
++  dest[idx] = '\0';
+       
+   return dest;
+ }
Index: stable/Makefile
===================================================================
RCS file: /cvs/ports/mail/mutt/stable/Makefile,v
retrieving revision 1.30
diff -u -p -r1.30 Makefile
--- stable/Makefile     2 Aug 2006 14:30:09 -0000       1.30
+++ stable/Makefile     3 May 2007 11:43:58 -0000
@@ -4,6 +4,7 @@ COMMENT=        "tty-based e-mail client"
 
 VERSION=       1.4.2.2
 DISTNAME=      mutt-${VERSION}i
+PKGNAME=       ${DISTNAME}p0
 MASTER_SITES=  ${MASTER_SITES_MUTT}
 
 .include <bsd.port.mk>
Index: stable/patches/patch-muttlib_c
===================================================================
RCS file: /cvs/ports/mail/mutt/stable/patches/patch-muttlib_c,v
retrieving revision 1.1
diff -u -p -r1.1 patch-muttlib_c
--- stable/patches/patch-muttlib_c      5 Sep 2005 20:17:33 -0000       1.1
+++ stable/patches/patch-muttlib_c      3 May 2007 11:43:58 -0000
@@ -1,7 +1,29 @@
-$OpenBSD: patch-muttlib_c,v 1.1 2005/09/05 20:17:33 fgsch Exp $
---- muttlib.c.orig     Tue Aug 30 20:31:27 2005
-+++ muttlib.c  Tue Aug 30 20:39:17 2005
-@@ -809,8 +809,8 @@ void mutt_expand_fmt (char *dest, size_t
+$OpenBSD$
+--- muttlib.c.orig     Mon Mar 25 12:29:32 2002
++++ muttlib.c  Thu May  3 13:40:25 2007
+@@ -509,16 +509,19 @@ char *mutt_gecos_name (char *dest, size_t destlen, str
+ 
+   pwnl = strlen (pw->pw_name);
+ 
+-  for (idx = 0; dest[idx]; idx++)
++  for (idx = 0; dest[idx] && idx < destlen - 1; idx++)
+   {
+     if (dest[idx] == '&')
+     {
+-      memmove (&dest[idx + pwnl], &dest[idx + 1],
++      /* Don't move if destination is outside buffer. */
++      if (idx + pwnl < destlen)
++        memmove (&dest[idx + pwnl], &dest[idx + 1],
+              MAX(destlen - idx - pwnl - 1, 0));
+       memcpy (&dest[idx], pw->pw_name, MIN(destlen - idx - 1, pwnl));
+       dest[idx] = toupper (dest[idx]);
+     }
+   }
++  dest[idx] = '\0';
+       
+   return dest;
+ }
+@@ -809,8 +812,8 @@ void mutt_expand_fmt (char *dest, size_t destlen, cons
      }
      else if (p[1] == '%')
        p++;

Reply via email to