aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-10-28 21:20:57 +0000
committerRichard Stallman <rms@gnu.org>1992-10-28 21:20:57 +0000
commit05d32ae0e0dceefa26a98e5dc9ba3665c27be765 (patch)
treeb046227902985f0d31e32b388f45774cd913a4c2 /gcc
parentd4b048eff88a330271411e652dc65b2fbf8a6951 (diff)
downloadgcc-05d32ae0e0dceefa26a98e5dc9ba3665c27be765.zip
gcc-05d32ae0e0dceefa26a98e5dc9ba3665c27be765.tar.gz
gcc-05d32ae0e0dceefa26a98e5dc9ba3665c27be765.tar.bz2
(process_command): Check that we have enough arguments.
From-SVN: r2636
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gcc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index f1cf450..74e53b4 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)