aboutsummaryrefslogtreecommitdiff
path: root/binutils/ar.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-04-26 15:42:03 +0100
committerNick Clifton <nickc@redhat.com>2017-04-26 15:42:03 +0100
commit740a463062bd5d1641bdfb639295dafe89341b9b (patch)
treeedbe0f3ede697d9f3b253ad3b3e175a3b2949a5f /binutils/ar.c
parent3e6b644558f941d3fe482e15efbc53d8f39ef8b7 (diff)
downloadgdb-740a463062bd5d1641bdfb639295dafe89341b9b.zip
gdb-740a463062bd5d1641bdfb639295dafe89341b9b.tar.gz
gdb-740a463062bd5d1641bdfb639295dafe89341b9b.tar.bz2
Fix invocation of stat() on a NULL pointer.
PR binutils/21407 * bucomm.c (get_file_size): Return -1 if file_name is NULL. * ar.c (main): Fail with usage() invocation if no file names are provided.
Diffstat (limited to 'binutils/ar.c')
-rw-r--r--binutils/ar.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/binutils/ar.c b/binutils/ar.c
index 32ac404..ef8b5bd 100644
--- a/binutils/ar.c
+++ b/binutils/ar.c
@@ -738,6 +738,9 @@ main (int argc, char **argv)
arg_index = 0;
+ if (argv[arg_index] == NULL)
+ usage (0);
+
if (mri_mode)
{
default_deterministic ();