Author: delphij
Date: Tue Mar 30 21:54:25 2010
New Revision: 205938
URL: http://svn.freebsd.org/changeset/base/205938

Log:
  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
  MFC after:    1 month

Modified:
  head/usr.sbin/mailwrapper/mailwrapper.8
  head/usr.sbin/mailwrapper/mailwrapper.c

Modified: head/usr.sbin/mailwrapper/mailwrapper.8
==============================================================================
--- head/usr.sbin/mailwrapper/mailwrapper.8     Tue Mar 30 21:11:16 2010        
(r205937)
+++ head/usr.sbin/mailwrapper/mailwrapper.8     Tue Mar 30 21:54:25 2010        
(r205938)
@@ -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: head/usr.sbin/mailwrapper/mailwrapper.c
==============================================================================
--- head/usr.sbin/mailwrapper/mailwrapper.c     Tue Mar 30 21:11:16 2010        
(r205937)
+++ head/usr.sbin/mailwrapper/mailwrapper.c     Tue Mar 30 21:54:25 2010        
(r205938)
@@ -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);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to