From owner-svn-src-all@FreeBSD.ORG Wed Dec 11 14:54:59 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2C238B14; Wed, 11 Dec 2013 14:54:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18EEE1285; Wed, 11 Dec 2013 14:54:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBBEswCq013676; Wed, 11 Dec 2013 14:54:58 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBBEswxF013675; Wed, 11 Dec 2013 14:54:58 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201312111454.rBBEswxF013675@svn.freebsd.org> From: Eitan Adler Date: Wed, 11 Dec 2013 14:54:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259219 - head/usr.bin/calendar X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2013 14:54:59 -0000 Author: eadler Date: Wed Dec 11 14:54:58 2013 New Revision: 259219 URL: http://svnweb.freebsd.org/changeset/base/259219 Log: calendar(1): use strlcpy instead of strncpy use strlcpy instead of strncpy which avoids non-null-termination if the string is MAXPATHLEN bytes or longer. Modified: head/usr.bin/calendar/calcpp.c Modified: head/usr.bin/calendar/calcpp.c ============================================================================== --- head/usr.bin/calendar/calcpp.c Wed Dec 11 13:20:32 2013 (r259218) +++ head/usr.bin/calendar/calcpp.c Wed Dec 11 14:54:58 2013 (r259219) @@ -133,7 +133,7 @@ tokenscpp(char *buf, char *string) s = p; while(!isspace((unsigned char)*p)) p++; - strncpy(string, s, MAXPATHLEN); + strlcpy(string, s, MAXPATHLEN); return(T_DEFINE); } else if ((p = strstr(buf, "#ifndef")) != NULL) { p += 8;