From owner-freebsd-bugs Mon Apr 7 14:10:08 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id OAA13389 for bugs-outgoing; Mon, 7 Apr 1997 14:10:08 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id OAA13369; Mon, 7 Apr 1997 14:10:03 -0700 (PDT) Resent-Date: Mon, 7 Apr 1997 14:10:03 -0700 (PDT) Resent-Message-Id: <199704072110.OAA13369@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, charnier@xp11.frmug.org Received: from frmug.org (frmug-gw.frmug.org [193.56.58.252]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id OAA12869 for ; Mon, 7 Apr 1997 14:02:38 -0700 (PDT) Received: (from uucp@localhost) by frmug.org (8.8.5/8.8.5/frmug-2.0) with UUCP id XAA27426 for FreeBSD-gnats-submit@freebsd.org; Mon, 7 Apr 1997 23:02:26 +0200 (MET DST) Received: (from charnier@localhost) by xp11.frmug.org (8.8.5/8.8.5/xp11-uucp-1.1) id WAA02153; Mon, 7 Apr 1997 22:57:36 +0200 (CEST) Message-Id: <199704072057.WAA02153@xp11.frmug.org> Date: Mon, 7 Apr 1997 22:57:36 +0200 (CEST) From: Philippe Charnier Reply-To: charnier@xp11.frmug.org To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/3222: null terminate after strncpy Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >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: