commit e96144118e239e99070d7de79a980c777cfa36bc
parent e58513301210fa245ae91f41c3ba4935c2713368
Author: sin <sin@2f30.org>
Date: Wed, 8 Jan 2014 20:20:04 +0000
Error out if a single argument cannot fit into the argument space
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/xargs.c b/xargs.c
@@ -84,6 +84,8 @@ main(int argc, char *argv[])
while ((arg = poparg())) {
if (argsz + strlen(arg) + 1 > argmaxsz ||
i >= NARGS - 1) {
+ if (strlen(arg) + 1 > argmaxsz)
+ enprintf(EXIT_FAILURE, "insufficient argument space\n");
pusharg(arg);
break;
}