Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Apr 2010 00:38:15 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r207352 - stable/7/usr.sbin/mailwrapper
Message-ID:  <201004290038.o3T0cFfI095812@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Thu Apr 29 00:38:15 2010
New Revision: 207352
URL: http://svn.freebsd.org/changeset/base/207352

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/7/usr.sbin/mailwrapper/mailwrapper.8
  stable/7/usr.sbin/mailwrapper/mailwrapper.c
Directory Properties:
  stable/7/usr.sbin/mailwrapper/   (props changed)

Modified: stable/7/usr.sbin/mailwrapper/mailwrapper.8
==============================================================================
--- stable/7/usr.sbin/mailwrapper/mailwrapper.8	Thu Apr 29 00:28:34 2010	(r207351)
+++ stable/7/usr.sbin/mailwrapper/mailwrapper.8	Thu Apr 29 00:38:15 2010	(r207352)
@@ -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/7/usr.sbin/mailwrapper/mailwrapper.c
==============================================================================
--- stable/7/usr.sbin/mailwrapper/mailwrapper.c	Thu Apr 29 00:28:34 2010	(r207351)
+++ stable/7/usr.sbin/mailwrapper/mailwrapper.c	Thu Apr 29 00:38:15 2010	(r207352)
@@ -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);



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