Package: esmtp
Version: 1.2-4squeeze1
Severity: normal
Tags: patch

Test case:
esmtp -t -i < ../mail_with_heads.txt
and inside this file:
#v+
To:
From: alice

test
#v-



-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (600, 'testing'), (500, 'stable-updates'), (500, 'stable'), (50, 
'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.39-2-686-pae (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -r a7f3dfe362ea local.c
--- a/local.c	Tue Aug 02 13:20:54 2011 +0200
+++ b/local.c	Tue Aug 02 14:18:58 2011 +0200
@@ -106,7 +106,8 @@
 				}
 				p += written;
 			}
-			names[--nameslen] = '\0';		/* chop trailing space */
+			if(nameslen > 0) --nameslen;
+			names[nameslen] = '\0';		/* chop trailing space */
 		} else {
 			nameslen = (strlen(force_mda) + 3);	// 'force_mda'
 			names = (char *)xmalloc(nameslen + 1);	// 'force_mda'\0

Reply via email to