Ensure string termination after strncpy().

PR:		2997
Submitted by:	Philippe Charnier <charnier@xp11.frmug.org>
This commit is contained in:
Joerg Wunsch 1997-05-09 16:00:35 +00:00
parent a973eeb2c1
commit 7e97db380c

View File

@ -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':