svn commit: r246860 - head/usr.bin/mail

Dimitry Andric dim at FreeBSD.org
Fri Feb 15 23:59:58 UTC 2013


Author: dim
Date: Fri Feb 15 23:59:57 2013
New Revision: 246860
URL: http://svnweb.freebsd.org/changeset/base/246860

Log:
  Fix undefined behaviour in usr.bin/mail/util.c.
  
  Reported by:	deeptech71 at gmail.com
  MFC after:	3 days

Modified:
  head/usr.bin/mail/util.c

Modified: head/usr.bin/mail/util.c
==============================================================================
--- head/usr.bin/mail/util.c	Fri Feb 15 23:41:47 2013	(r246859)
+++ head/usr.bin/mail/util.c	Fri Feb 15 23:59:57 2013	(r246860)
@@ -236,8 +236,8 @@ istrncpy(char *dest, const char *src, si
 {
 
 	strlcpy(dest, src, dsize);
-	while (*dest)
-		*dest++ = tolower((unsigned char)*dest);
+	for (; *dest; dest++)
+		*dest = tolower((unsigned char)*dest);
 }
 
 /*


More information about the svn-src-head mailing list