diff options
author | Alan Modra <amodra@gmail.com> | 2017-04-23 17:39:48 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2017-04-23 20:33:35 +0930 |
commit | 42354845ae5e00ec1c3519e1f2166b79a9533401 (patch) | |
tree | c25c44adf4ac1abf0e300c19937cfdbdf086a8c2 /binutils/ar.c | |
parent | 7034215fd6d99f275998f7f0f8a346ab35fcbee6 (diff) | |
download | gdb-42354845ae5e00ec1c3519e1f2166b79a9533401.zip gdb-42354845ae5e00ec1c3519e1f2166b79a9533401.tar.gz gdb-42354845ae5e00ec1c3519e1f2166b79a9533401.tar.bz2 |
PR 21418, ar -N lacks arg check
PR 21418
* ar.c (main): Check -a, -b, -i and -N args are given.
Diffstat (limited to 'binutils/ar.c')
-rw-r--r-- | binutils/ar.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/binutils/ar.c b/binutils/ar.c index 8e4d81c..32ac404 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -776,12 +776,18 @@ main (int argc, char **argv) default_deterministic (); if (postype != pos_default) - posname = argv[arg_index++]; + { + posname = argv[arg_index++]; + if (posname == NULL) + fatal (_("missing position arg.")); + } if (counted_name_mode) { if (operation != extract && operation != del) fatal (_("`N' is only meaningful with the `x' and `d' options.")); + if (argv[arg_index] == NULL) + fatal (_("`N' missing value.")); counted_name_counter = atoi (argv[arg_index++]); if (counted_name_counter <= 0) fatal (_("Value for `N' must be positive.")); |