Subject: CVS commit: [netbsd-4] src/lib/libutil
To: None <source-changes@NetBSD.org>
From: Liam J. Foy <liamjfoy@netbsd.org>
List: source-changes
Date: 07/27/2007 09:51:40
Module Name:	src
Committed By:	liamjfoy
Date:		Fri Jul 27 09:51:40 UTC 2007

Modified Files:
	src/lib/libutil [netbsd-4]: sockaddr_snprintf.c

Log Message:
Pull up following revision(s) (requested by dyoung in ticket #794):
	lib/libutil/sockaddr_snprintf.c: revision 1.8
In sockaddr_snprintf(sbuf, len, fmt, sa), do not write the terminating
null character outside of the byte region [sbuf, sbuf + len).
1) If the length of the buffer is 0, do not write a null character
   at all.  Previously, sockaddr_snprintf() may have been able to
   overwrite sbuf[-1] if len was 0.
2) If the length of the buffer, len, is greater than 0, then write
   the null at sbuf[len - 1].  Previously, sockaddr_snprintf()
   wrote the null at buf[len - 1], where `buf' was a "cursor" that
   did not necessarily equal `sbuf', the start of the buffer.  Now,
   sockaddr_snprintf() always writes the null at sbuf[len - 1].


To generate a diff of this commit:
cvs rdiff -r1.6.4.1 -r1.6.4.2 src/lib/libutil/sockaddr_snprintf.c

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