]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
argv was set but unused
authorKurt Roeckx <kurt@roeckx.be>
Sun, 14 Feb 2016 19:45:02 +0000 (20:45 +0100)
committerKurt Roeckx <kurt@roeckx.be>
Sat, 20 Feb 2016 13:53:53 +0000 (14:53 +0100)
Also gives an error message when you gave it a parameter it didn't expect.

Reviewed-by: Rich Salz <rsalz@openssl.org>
MR: #2009

23 files changed:
apps/asn1pars.c
apps/crl.c
apps/crl2p7.c
apps/dsa.c
apps/ec.c
apps/ecparam.c
apps/genpkey.c
apps/nseq.c
apps/ocsp.c
apps/pkcs12.c
apps/pkcs7.c
apps/pkcs8.c
apps/pkey.c
apps/pkeyparam.c
apps/pkeyutl.c
apps/req.c
apps/rsa.c
apps/rsautl.c
apps/s_client.c
apps/s_time.c
apps/sess_id.c
apps/spkac.c
apps/ts.c

index f7fa8f35313b88588a4e680238033e4d14c664c0..a6cc6397fad8a6d9227ca36c3739b114b34ce219 100644 (file)
@@ -184,7 +184,8 @@ int asn1parse_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     if (oidfile != NULL) {
         in = bio_open_default(oidfile, 'r', FORMAT_TEXT);
index 3f64cdd57a2c0f845d478a21fa8f17176bc56c8a..c6fc9e667540a9e16d051133e381d4bf512f35ca 100644 (file)
@@ -227,7 +227,8 @@ int crl_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     if (!nmflag_set)
         nmflag = XN_FLAG_ONELINE;
index 74bb8939003924b2656ef604154c402005265e59..e864973b0923530a48f6334647cae50864445368 100644 (file)
@@ -146,7 +146,8 @@ int crl2pkcs7_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     if (!nocrl) {
         in = bio_open_default(infile, 'r', informat);
index 5ee97cf66bb692371ca3dc48073da57e4839d2d9..79c6fb29b4f1a363e24f69409e3b7f607426212d 100644 (file)
@@ -194,7 +194,9 @@ int dsa_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
+
     private = pubin || pubout ? 0 : 1;
     if (text && !pubin)
         private = 1;
index 6f811e35c9045a292fd36326ff64e16eef9926c2..432e9ff5eb2fd3cebe02aa735ed5fb8fc01e6c97 100644 (file)
--- a/apps/ec.c
+++ b/apps/ec.c
@@ -205,7 +205,9 @@ int ec_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
+
     private = param_out || pubin || pubout ? 0 : 1;
     if (text && !pubin)
         private = 1;
index 7889caccefb35c8dcb147ca1a1c46801c9eade01..55d71f7fd41e597be45b21f957f00e7834ba25d4 100644 (file)
@@ -220,7 +220,9 @@ int ecparam_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
+
     private = genkey ? 1 : 0;
 
     in = bio_open_default(infile, 'r', informat);
index 01564131a09254de05a3f855928b1628d8c74154..905eb1992f23b0a4ad111cbcbf027e9d1d6a29f8 100644 (file)
@@ -170,7 +170,9 @@ int genpkey_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
+
     private = do_param ? 0 : 1;
 
     if (ctx == NULL)
index fd63bd821ba3b4833a28018b86137a004010d007..4bc4f3282889e0956eef43d65a26bfb711db5e7a 100644 (file)
@@ -89,6 +89,7 @@ int nseq_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,7 +108,8 @@ int nseq_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     in = bio_open_default(infile, 'r', FORMAT_PEM);
     if (in == NULL)
index 502adf1ba5ad134f2a7bb831ba6b7cc3282937a9..e26afe1f94b0e10e060e214f4c318989c8d25037 100644 (file)
@@ -491,7 +491,8 @@ int ocsp_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     /* Have we anything to do? */
     if (!req && !reqin && !respin && !(port && ridx_filename))
index 2b9a08024c392790865031acda70cc08ddd70103..e8df4998f7e5353846dd5f39bf9e955ed91b581c 100644 (file)
@@ -325,7 +325,9 @@ int pkcs12_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
+
     private = 1;
 
     if (passarg) {
index 1ed0b013395b95f33c8ca0ba150cee6057177f65..ad8330d42ff76e0864be2ed01b3cf60b19517da8 100644 (file)
@@ -191,7 +191,8 @@ int pkcs7_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     in = bio_open_default(infile, 'r', informat);
     if (in == NULL)
index 5db78fc216d3b46527077f99cc0664cc994f2ded..125bf6158ac894227670e60f1e4ca1bbee54a33e 100644 (file)
@@ -225,7 +225,9 @@ int pkcs8_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
+
     private = 1;
 
     if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
index 6f5ecf0ce658cd5842788deb5d0be5451b64614c..122ced706cdfde5b0e2bf4db62b985ab882891e9 100644 (file)
@@ -159,7 +159,9 @@ int pkey_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
+
     private = !noout && !pubout ? 1 : 0;
     if (text && !pubtext)
         private = 1;
index abb40d1ab29c98133d5cfe13d155ce7bb0974058..d55adef1ca000e5b295965d0d90e60a9f4f0b787 100644 (file)
@@ -92,6 +92,7 @@ int pkeyparam_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:
@@ -116,7 +117,8 @@ int pkeyparam_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     in = bio_open_default(infile, 'r', FORMAT_PEM);
     if (in == NULL)
index 5a2827b3997a96ee82061e0332d4e8bb10a9ca1c..8e1177738e9b60f3ba24d8d17a4da07d9dca5fcd 100644 (file)
@@ -225,7 +225,8 @@ int pkeyutl_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     if (inkey == NULL ||
         (peerkey != NULL && pkey_op != EVP_PKEY_OP_DERIVE))
index 4900a922912cdfbf7ff61a9f37eef00662f55321..facc63967d7e00143e205519ca819673acfcdce7 100644 (file)
@@ -367,7 +367,8 @@ int req_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     if (!nmflag_set)
         nmflag = XN_FLAG_ONELINE;
index 23383d93de3a32b9d8d9c875587ba08167698b66..5320f38455fcc90e086a601402f89a7f4c76c90f 100644 (file)
@@ -252,7 +252,9 @@ int rsa_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
+
     private = (text && !pubin) || (!pubout && !noout) ? 1 : 0;
 
     if (!app_passwd(passinarg, passoutarg, &passin, &passout)) {
index f00c2e3ad6819b41ecc9d8035c8d94a0cd01495c..08e4d5635ef0a65a3ec8575f00b6989b5e6eeab1 100644 (file)
@@ -205,7 +205,8 @@ int rsautl_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     if (need_priv && (key_type != KEY_PRIVKEY)) {
         BIO_printf(bio_err, "A private key is needed for this operation\n");
index ca630f0a2ff385df64b77eaa86f7d6a9ed70c524..9d0b52a10f05cd8e62a5095047c27ddd5a43bcf5 100644 (file)
@@ -1341,7 +1341,8 @@ int s_client_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     if (proxystr) {
         int res;
index 6514fb21972dba446909b9dd19be0131384b980d..fd001483f72f46eb7504accf2f3bf5a99eec4c55 100644 (file)
@@ -237,7 +237,8 @@ int s_time_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     if (cipher == NULL)
         cipher = getenv("SSL_CIPHER");
index 2be2692f087484c42aa7d23cf99c183aa3816d5d..f40f131e1bd588258943e4a844375cee27c328c8 100644 (file)
@@ -139,7 +139,8 @@ int sess_id_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     x = load_sess_id(infile, informat);
     if (x == NULL) {
index 9cbe7fe2e8f61520d9bfecf20748f3235b741448..07f36d370d60cc9ec27280afc081d1fdc3c5d169 100644 (file)
@@ -112,6 +112,7 @@ int spkac_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:
@@ -154,7 +155,8 @@ int spkac_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
+    if (argc != 0)
+        goto opthelp;
 
     if (!app_passwd(passinarg, NULL, &passin, NULL)) {
         BIO_printf(bio_err, "Error getting password\n");
index 00b5e53f7c7a00503936847a5f7c9e1001d32100..ee04bb5ad8b3144b26f399c10239361bd8873be8 100644 (file)
--- a/apps/ts.c
+++ b/apps/ts.c
@@ -299,7 +299,6 @@ int ts_main(int argc, char **argv)
         }
     }
     argc = opt_num_rest();
-    argv = opt_rest();
     if (mode == OPT_ERR || argc != 0)
         goto opthelp;