Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Mar 1997 23:51:03 +0100 (CET)
From:      Philippe Charnier <charnier@xp11.frmug.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/2997: unterminated string after strncpy
Message-ID:  <199703152251.XAA05444@xp11.frmug.org>
Resent-Message-ID: <199703152310.PAA14872@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         2997
>Category:       bin
>Synopsis:       unterminated string after strncpy
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 15 15:10:04 PST 1997
>Last-Modified:
>Originator:     Philippe Charnier
>Organization:
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

	

>Description:

	

>How-To-Repeat:

	

>Fix:
	
Index: bin/rcp/rcp.c
===================================================================
RCS file: /home2h/FreeBSD.cvsroot/src/bin/rcp/rcp.c,v
retrieving revision 1.11
diff -u -r1.11 rcp.c
--- rcp.c	1997/02/22 14:05:22	1.11
+++ rcp.c	1997/03/12 22:11:13
@@ -131,7 +131,8 @@
 #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':

>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703152251.XAA05444>