From 7034215fd6d99f275998f7f0f8a346ab35fcbee6 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sun, 23 Apr 2017 17:28:14 +0930 Subject: [PATCH] PR 21417, ar arg check failure PR 21417 * ar.c (main): Check that an archive file is given after options. --- binutils/ChangeLog | 5 +++++ binutils/ar.c | 2 ++ 2 files changed, 7 insertions(+) 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; -- 2.30.2