From 327a0c47bfdb1b11a6f7aabe7569509e8e243099 Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Sat, 7 Jun 2014 15:52:54 -0400 Subject: [PATCH] Check for extra arguments when importing or converting. To prevent misuse. --- src/pwmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pwmd.c b/src/pwmd.c index 44773858..f9b7eb91 100644 --- a/src/pwmd.c +++ b/src/pwmd.c @@ -2827,7 +2827,7 @@ main (int argc, char *argv[]) if (convertfile) { - if (!outfile) + if (!outfile || !*outfile || argc != optind) usage (argv[0], EXIT_FAILURE); estatus = convert_v2_datafile (convertfile, cipher, keyfile, keygrip, @@ -2840,7 +2840,7 @@ main (int argc, char *argv[]) if (import) { - if (!outfile || !*outfile) + if (!outfile || !*outfile || argc != optind) usage (argv[0], EXIT_FAILURE); if (outfile && outfile[0] == '-' && outfile[1] == 0) -- 2.11.4.GIT