From e96144118e239e99070d7de79a980c777cfa36bc Mon Sep 17 00:00:00 2001 From: sin Date: Wed, 8 Jan 2014 20:20:04 +0000 Subject: [PATCH] Error out if a single argument cannot fit into the argument space --- xargs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xargs.c b/xargs.c index d18cb88..b0c43b5 100644 --- 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; }