From 3ab607dea3d3e511b3d6453ac58971908a2b595e Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 7 Jun 2021 06:27:10 -0700 Subject: args: correction in assertion. * args.c (args_normalize_least): The bug_unless here should be checking that minfill is not beyond argc->argc. That's the situation that would cause the loop to overflow the fixed argument argument storage in args indicated by args->argc. --- args.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/args.c b/args.c index 796fecaa..794e69dd 100644 --- a/args.c +++ b/args.c @@ -59,7 +59,7 @@ void args_normalize_exact(struct args *args, cnum fill) void args_normalize_least(struct args *args, cnum minfill) { - bug_unless (args->fill <= args->argc); + bug_unless (minfill <= args->argc); while (args->fill < minfill && args->list) args_add(args, pop(&args->list)); -- cgit v1.2.3