Re: [patch] xargs - few allocation size fixes

2018-06-12 Thread Todd C. Miller
On Tue, 12 Jun 2018 13:29:08 -, David CARLIER wrote:

> here a little patch proposal for xargs command line.

That fix is correct.  I'll commit it unless there are objections.

 - todd



[patch] xargs - few allocation size fixes

2018-06-12 Thread David CARLIER
Hi,

here a little patch proposal for xargs command line.

Thanks.

Kind regards.
Index: xargs.c
===
RCS file: /cvs/src/usr.bin/xargs/xargs.c,v
retrieving revision 1.33
diff -u -p -r1.33 xargs.c
--- xargs.c	16 Oct 2017 13:10:50 -	1.33
+++ xargs.c	11 Jun 2018 10:05:23 -
@@ -198,7 +198,7 @@ main(int argc, char *argv[])
 	 * NULL.
 	 */
 	linelen = 1 + argc + nargs + 1;
-	if ((av = bxp = calloc(linelen, sizeof(char **))) == NULL)
+	if ((av = bxp = calloc(linelen, sizeof(char *))) == NULL)
 		err(1, NULL);
 
 	/*
@@ -438,7 +438,7 @@ prerun(int argc, char *argv[])
 	 * Allocate memory to hold the argument list, and
 	 * a NULL at the tail.
 	 */
-	tmp = calloc(argc + 1, sizeof(char**));
+	tmp = calloc(argc + 1, sizeof(char *));
 	if (tmp == NULL)
 		err(1, NULL);
 	tmp2 = tmp;