svn commit: r207351 - stable/8/usr.sbin/mailwrapper
Xin LI
delphij at FreeBSD.org
Thu Apr 29 00:28:35 UTC 2010
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);
More information about the svn-src-stable-8
mailing list