diff options
author | joerg <joerg@FreeBSD.org> | 1997-05-09 16:00:35 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1997-05-09 16:00:35 +0000 |
commit | 9904a8c9de5e73122cfafcd856dbd701854bfc0a (patch) | |
tree | 5739645ec94be6911328f09ddfe00099f0adabe6 /bin/rcp/rcp.c | |
parent | ab4272e09ecd5d3838b564026ac4cbdb411fec35 (diff) | |
download | FreeBSD-src-9904a8c9de5e73122cfafcd856dbd701854bfc0a.zip FreeBSD-src-9904a8c9de5e73122cfafcd856dbd701854bfc0a.tar.gz |
Ensure string termination after strncpy().
PR: 2997
Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
Diffstat (limited to 'bin/rcp/rcp.c')
-rw-r--r-- | bin/rcp/rcp.c | 5 |
1 files changed, 3 insertions, 2 deletions
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': |