From: Richard Stallman Date: Wed, 28 Oct 1992 21:20:57 +0000 (+0000) Subject: (process_command): Check that we have enough arguments. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=05d32ae0e0dceefa26a98e5dc9ba3665c27be765;p=gcc.git (process_command): Check that we have enough arguments. From-SVN: r2636 --- diff --git a/gcc/gcc.c b/gcc/gcc.c index f1cf450865c..74e53b4faad 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -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)