From 3ee13251e16e6734ae58cda526729e6008576994 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Wed, 26 Mar 1997 01:19:50 +0000 Subject: unterminated buffer; charnier@xp11.frmug.org --- bin/rcp/rcp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c index 2052c22c0a9..0916690386c 100644 --- a/bin/rcp/rcp.c +++ b/bin/rcp/rcp.c @@ -1,5 +1,5 @@ /* $NetBSD: rcp.c,v 1.9 1995/03/21 08:19:06 cgd Exp $ */ -/* $OpenBSD: rcp.c,v 1.9 1997/01/15 23:40:25 millert Exp $ */ +/* $OpenBSD: rcp.c,v 1.10 1997/03/26 01:19:49 deraadt Exp $ */ /* * Copyright (c) 1983, 1990, 1992, 1993 @@ -134,7 +134,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; case 'x': doencrypt = 1; -- cgit v1.2.3