(process_command): Check that we have enough arguments.

From-SVN: r2636
This commit is contained in:
Richard Stallman 1992-10-28 21:20:57 +00:00
parent d4b048eff8
commit 05d32ae0e0
1 changed files with 2 additions and 0 deletions

View File

@ -2197,6 +2197,8 @@ process_command (argc, argv)
/* Count only the option arguments in separate argv elements. */
n_args = SWITCH_TAKES_ARG (c) - (p[1] != 0);
}
if (i + n_args >= argc)
fatal ("argument to `-%s' is missing", p);
switches[n_switches].args
= (char **) xmalloc ((n_args + 1) * sizeof (char *));
while (j < n_args)