From: Alan Modra Date: Sun, 23 Apr 2017 07:58:14 +0000 (+0930) Subject: PR 21417, ar arg check failure X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7034215fd6d99f275998f7f0f8a346ab35fcbee6;p=binutils-gdb.git PR 21417, ar arg check failure PR 21417 * ar.c (main): Check that an archive file is given after options. --- diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 735a3445512..13a665cd3ed 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,8 @@ +2017-04-23 Alan Modra + + PR 21417 + * ar.c (main): Check that an archive file is given after options. + 2017-04-23 Alan Modra PR 21415 diff --git a/binutils/ar.c b/binutils/ar.c index 274be4685a7..8e4d81cc47c 100644 --- a/binutils/ar.c +++ b/binutils/ar.c @@ -788,6 +788,8 @@ main (int argc, char **argv) } inarch_filename = argv[arg_index++]; + if (inarch_filename == NULL) + usage (0); for (file_count = 0; argv[arg_index + file_count] != NULL; file_count++) continue;