Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Apr 1997 22:57:36 +0200 (CEST)
From:      Philippe Charnier <charnier@xp11.frmug.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/3222: null terminate after strncpy
Message-ID:  <199704072057.WAA02153@xp11.frmug.org>
Resent-Message-ID: <199704072110.OAA13369@freefall.freebsd.org>

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

>Number:         3222
>Category:       bin
>Synopsis:       Add null termination after strncpy
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr  7 14:10:01 PDT 1997
>Last-Modified:
>Originator:     Philippe Charnier
>Organization:
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

	

>Description:

>How-To-Repeat:

>Fix:

Index: rcp.c
===================================================================
RCS file: /home2h/FreeBSD.cvsroot/src/bin/rcp/rcp.c,v
retrieving revision 1.12
diff -u -r1.12 rcp.c
--- rcp.c	1997/03/28 15:24:32	1.12
+++ rcp.c	1997/04/07 19:05:39
@@ -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?199704072057.WAA02153>