From: deraadt Date: Wed, 26 Mar 1997 01:19:49 +0000 (+0000) Subject: unterminated buffer; charnier@xp11.frmug.org X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d088447b63a8941654a4d9c974e5b5539560368f;p=openbsd unterminated buffer; charnier@xp11.frmug.org --- 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;