GNU Binutils with patches for OS216
Révision | 42354845ae5e00ec1c3519e1f2166b79a9533401 (tree) |
---|---|
l'heure | 2017-04-23 20:03:35 |
Auteur | Alan Modra <amodra@gmai...> |
Commiter | Alan Modra |
PR 21418, ar -N lacks arg check
PR 21418
* ar.c (main): Check -a, -b, -i and -N args are given.
@@ -1,5 +1,10 @@ | ||
1 | 1 | 2017-04-23 Alan Modra <amodra@gmail.com> |
2 | 2 | |
3 | + PR 21418 | |
4 | + * ar.c (main): Check -a, -b, -i and -N args are given. | |
5 | + | |
6 | +2017-04-23 Alan Modra <amodra@gmail.com> | |
7 | + | |
3 | 8 | PR 21417 |
4 | 9 | * ar.c (main): Check that an archive file is given after options. |
5 | 10 |
@@ -776,12 +776,18 @@ main (int argc, char **argv) | ||
776 | 776 | default_deterministic (); |
777 | 777 | |
778 | 778 | if (postype != pos_default) |
779 | - posname = argv[arg_index++]; | |
779 | + { | |
780 | + posname = argv[arg_index++]; | |
781 | + if (posname == NULL) | |
782 | + fatal (_("missing position arg.")); | |
783 | + } | |
780 | 784 | |
781 | 785 | if (counted_name_mode) |
782 | 786 | { |
783 | 787 | if (operation != extract && operation != del) |
784 | 788 | fatal (_("`N' is only meaningful with the `x' and `d' options.")); |
789 | + if (argv[arg_index] == NULL) | |
790 | + fatal (_("`N' missing value.")); | |
785 | 791 | counted_name_counter = atoi (argv[arg_index++]); |
786 | 792 | if (counted_name_counter <= 0) |
787 | 793 | fatal (_("Value for `N' must be positive.")); |