Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Oct 2008 00:28:21 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r184188 - head/usr.sbin/nscd
Message-ID:  <200810230028.m9N0SLnc042673@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Thu Oct 23 00:28:21 2008
New Revision: 184188
URL: http://svn.freebsd.org/changeset/base/184188

Log:
  Use strlcpy() before strlen() instead of strncpy().

Modified:
  head/usr.sbin/nscd/nscdcli.c

Modified: head/usr.sbin/nscd/nscdcli.c
==============================================================================
--- head/usr.sbin/nscd/nscdcli.c	Thu Oct 23 00:27:35 2008	(r184187)
+++ head/usr.sbin/nscd/nscdcli.c	Thu Oct 23 00:28:21 2008	(r184188)
@@ -187,7 +187,7 @@ open_nscd_connection__(struct nscd_conne
 
 	client_socket = socket(PF_LOCAL, SOCK_STREAM, 0);
 	client_address.sun_family = PF_LOCAL;
-	strncpy(client_address.sun_path, params->socket_path,
+	strlcpy(client_address.sun_path, params->socket_path,
 		sizeof(client_address.sun_path));
 	client_address_len = sizeof(client_address.sun_family) +
 		strlen(client_address.sun_path) + 1;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810230028.m9N0SLnc042673>