summaryrefslogtreecommitdiffstats
path: root/apps/version.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2017-08-20 17:10:48 -0400
committerRich Salz <rsalz@openssl.org>2017-08-21 10:58:49 -0400
commitc27363f566274a65067d7559f9669f300f957183 (patch)
tree8f6f6166011fdf04e168c4582212554874a20e98 /apps/version.c
parentb73b4d73de328de73c5a74ccc53291cd86a141e9 (diff)
Check # of arguments for remaining commands.
Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/4201)
Diffstat (limited to 'apps/version.c')
-rw-r--r--apps/version.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/version.c b/apps/version.c
index c9727daf52..57b9fd663f 100644
--- a/apps/version.c
+++ b/apps/version.c
@@ -72,6 +72,7 @@ int version_main(int argc, char **argv)
switch (o) {
case OPT_EOF:
case OPT_ERR:
+opthelp:
BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
goto end;
case OPT_HELP:
@@ -107,6 +108,10 @@ int version_main(int argc, char **argv)
break;
}
}
+ if (opt_num_rest() != 0) {
+ BIO_printf(bio_err, "Extra parameters given.\n");
+ goto opthelp;
+ }
if (!dirty)
version = 1;