diff options
author | John Beck <John.Beck@Sun.COM> | 2009-02-26 13:29:27 -0800 |
---|---|---|
committer | John Beck <John.Beck@Sun.COM> | 2009-02-26 13:29:27 -0800 |
commit | 25ccf31477c2a409aed8d0cf2027cd1073b0fe00 (patch) | |
tree | 5ccca57a525651df809fbe5163e40c38551a43ce | |
parent | 027021c7b9f04b74ae04cb1c3ddba52f2a2f9fd1 (diff) | |
download | illumos-joyent-25ccf31477c2a409aed8d0cf2027cd1073b0fe00.tar.gz |
6792839 Array overrun in mailq
-rw-r--r-- | usr/src/cmd/sendmail/aux/mailq.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr/src/cmd/sendmail/aux/mailq.c b/usr/src/cmd/sendmail/aux/mailq.c index 11ff6130c9..6f95cd8dc7 100644 --- a/usr/src/cmd/sendmail/aux/mailq.c +++ b/usr/src/cmd/sendmail/aux/mailq.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -18,12 +17,12 @@ * information: Portions Copyright [yyyy] [name of copyright owner] * * CDDL HEADER END - * - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" +/* + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. + * Use is subject to license terms. + */ #include <stdio.h> #include <stdlib.h> @@ -45,7 +44,8 @@ main(int argc, char *argv[], char *envp[]) int j; if (pw && chkauthattr(MAILQ_AUTH, pw->pw_name)) { - newargv = (char **)malloc((argc + 1) * sizeof (char *)); + /* The extra 2 is 1 for the "-bp" + 1 for the terminator. */ + newargv = (char **)malloc((argc + 2) * sizeof (char *)); if (newargv == NULL) exit(EX_UNAVAILABLE); newargv[0] = _PATH_SENDMAIL_BIN; |