svn commit: r216369 - head/lib/libipsec

Kevin Lo kevlo at FreeBSD.org
Sat Dec 11 08:07:21 UTC 2010


Author: kevlo
Date: Sat Dec 11 08:07:21 2010
New Revision: 216369
URL: http://svn.freebsd.org/changeset/base/216369

Log:
  The use of snprintf() to append to a buffer is not valid according to C99

Modified:
  head/lib/libipsec/ipsec_dump_policy.c

Modified: head/lib/libipsec/ipsec_dump_policy.c
==============================================================================
--- head/lib/libipsec/ipsec_dump_policy.c	Sat Dec 11 00:36:35 2010	(r216368)
+++ head/lib/libipsec/ipsec_dump_policy.c	Sat Dec 11 08:07:21 2010	(r216369)
@@ -162,7 +162,8 @@ ipsec_dump_policy(policy, delimiter)
 			return NULL;
 		}
 		buf = newbuf;
-		snprintf(buf, buflen, "%s%s%s", buf, delimiter, isrbuf);
+		snprintf(buf + strlen(buf), buflen - strlen(buf),
+		    "%s%s", delimiter, isrbuf);
 
 		off += xisr->sadb_x_ipsecrequest_len;
 	}


More information about the svn-src-head mailing list