From 9904a8c9de5e73122cfafcd856dbd701854bfc0a Mon Sep 17 00:00:00 2001 From: joerg Date: Fri, 9 May 1997 16:00:35 +0000 Subject: Ensure string termination after strncpy(). PR: 2997 Submitted by: Philippe Charnier --- bin/rcp/rcp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bin/rcp') diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c index a186f83..da63ae2 100644 --- a/bin/rcp/rcp.c +++ b/bin/rcp/rcp.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: rcp.c,v 1.11 1997/02/22 14:05:22 peter Exp $ + * $Id: rcp.c,v 1.12 1997/03/28 15:24:32 imp Exp $ */ #ifndef lint @@ -131,7 +131,8 @@ main(argc, argv) #ifdef KERBEROS case 'k': dest_realm = dst_realm_buf; - (void)strncpy(dst_realm_buf, optarg, REALM_SZ); + (void)strncpy(dst_realm_buf, optarg, REALM_SZ - 1); + dst_realm_buf[REALM_SZ - 1] = '\0'; break; #ifdef CRYPT case 'x': -- cgit v1.1