From owner-svn-src-all@FreeBSD.ORG Thu Apr 29 00:28:35 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B0AD106564A; Thu, 29 Apr 2010 00:28:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E52548FC0A; Thu, 29 Apr 2010 00:28:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o3T0SYLi087613; Thu, 29 Apr 2010 00:28:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o3T0SY5o087609; Thu, 29 Apr 2010 00:28:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201004290028.o3T0SY5o087609@svn.freebsd.org> From: Xin LI Date: Thu, 29 Apr 2010 00:28:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r207351 - stable/8/usr.sbin/mailwrapper X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 29 Apr 2010 00:28:35 -0000 Author: delphij Date: Thu Apr 29 00:28:34 2010 New Revision: 207351 URL: http://svn.freebsd.org/changeset/base/207351 Log: MFC r205938: Sync with OpenBSD: - avoid coredump when there's only one token on a line; - Use calloc(); - Remove a line inherited from example mdoc. Obtained from: OpenBSD Modified: stable/8/usr.sbin/mailwrapper/mailwrapper.8 stable/8/usr.sbin/mailwrapper/mailwrapper.c Directory Properties: stable/8/usr.sbin/mailwrapper/ (props changed) Modified: stable/8/usr.sbin/mailwrapper/mailwrapper.8 ============================================================================== --- stable/8/usr.sbin/mailwrapper/mailwrapper.8 Wed Apr 28 23:16:21 2010 (r207350) +++ stable/8/usr.sbin/mailwrapper/mailwrapper.8 Thu Apr 29 00:28:34 2010 (r207351) @@ -1,5 +1,5 @@ +.\" $OpenBSD: mailwrapper.8,v 1.10 2009/02/07 16:58:23 martynas Exp $ .\" $NetBSD: mailwrapper.8,v 1.11 2002/02/08 01:38:50 ross Exp $ -.\" $OpenBSD: mailwrapper.8,v 1.8 2003/06/12 12:59:51 jmc Exp $ .\" $FreeBSD$ .\" .\" Copyright (c) 1998 @@ -31,7 +31,6 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" The following requests are required for all man pages. .Dd August 7, 2006 .Dt MAILWRAPPER 8 .Os Modified: stable/8/usr.sbin/mailwrapper/mailwrapper.c ============================================================================== --- stable/8/usr.sbin/mailwrapper/mailwrapper.c Wed Apr 28 23:16:21 2010 (r207350) +++ stable/8/usr.sbin/mailwrapper/mailwrapper.c Thu Apr 29 00:28:34 2010 (r207351) @@ -1,4 +1,4 @@ -/* $OpenBSD: mailwrapper.c,v 1.16 2004/07/06 03:38:14 millert Exp $ */ +/* $OpenBSD: mailwrapper.c,v 1.18 2007/11/06 14:39:19 otto Exp $ */ /* $NetBSD: mailwrapper.c,v 1.9 2003/03/09 08:10:43 mjl Exp $ */ /* @@ -61,8 +61,8 @@ initarg(struct arglist *al) { al->argc = 0; al->maxc = 10; - if ((al->argv = malloc(al->maxc * sizeof(char *))) == NULL) - err(EX_TEMPFAIL, "malloc"); + if ((al->argv = calloc(al->maxc, sizeof(char *))) == NULL) + err(EX_TEMPFAIL, "calloc"); } static void @@ -126,7 +126,7 @@ main(int argc, char *argv[], char *envp[ continue; } - if ((from = strsep(&cp, WS)) == NULL) + if ((from = strsep(&cp, WS)) == NULL || cp == NULL) goto parse_error; cp += strspn(cp, WS);