[openssl-commits] [openssl] master update

Kurt Roeckx kurt at openssl.org
Sat Feb 20 14:00:33 UTC 2016


The branch master has been updated
       via  033585175485077bf7f5bbb352fd4f162d0c235f (commit)
      from  5ee719da047ab1de41882568b1ebdb745ce00aed (commit)


- Log -----------------------------------------------------------------
commit 033585175485077bf7f5bbb352fd4f162d0c235f
Author: Kurt Roeckx <kurt at roeckx.be>
Date:   Sun Feb 14 20:45:02 2016 +0100

    argv was set but unused
    
    Also gives an error message when you gave it a parameter it didn't expect.
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>
    
    MR: #2009

-----------------------------------------------------------------------

Summary of changes:
 apps/asn1pars.c  | 3 ++-
 apps/crl.c       | 3 ++-
 apps/crl2p7.c    | 3 ++-
 apps/dsa.c       | 4 +++-
 apps/ec.c        | 4 +++-
 apps/ecparam.c   | 4 +++-
 apps/genpkey.c   | 4 +++-
 apps/nseq.c      | 4 +++-
 apps/ocsp.c      | 3 ++-
 apps/pkcs12.c    | 4 +++-
 apps/pkcs7.c     | 3 ++-
 apps/pkcs8.c     | 4 +++-
 apps/pkey.c      | 4 +++-
 apps/pkeyparam.c | 4 +++-
 apps/pkeyutl.c   | 3 ++-
 apps/req.c       | 3 ++-
 apps/rsa.c       | 4 +++-
 apps/rsautl.c    | 3 ++-
 apps/s_client.c  | 3 ++-
 apps/s_time.c    | 3 ++-
 apps/sess_id.c   | 3 ++-
 apps/spkac.c     | 4 +++-
 apps/ts.c        | 1 -
 23 files changed, 55 insertions(+), 23 deletions(-)

diff --git a/apps/asn1pars.c b/apps/asn1pars.c
index f7fa8f3..a6cc639 100644
--- a/apps/asn1pars.c
+++ b/apps/asn1pars.c
@@ -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);
diff --git a/apps/crl.c b/apps/crl.c
index 3f64cdd..c6fc9e6 100644
--- a/apps/crl.c
+++ b/apps/crl.c
@@ -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;
diff --git a/apps/crl2p7.c b/apps/crl2p7.c
index 74bb893..e864973 100644
--- a/apps/crl2p7.c
+++ b/apps/crl2p7.c
@@ -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);
diff --git a/apps/dsa.c b/apps/dsa.c
index 5ee97cf..79c6fb2 100644
--- a/apps/dsa.c
+++ b/apps/dsa.c
@@ -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;
diff --git a/apps/ec.c b/apps/ec.c
index 6f811e3..432e9ff 100644
--- 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;
diff --git a/apps/ecparam.c b/apps/ecparam.c
index 7889cac..55d71f7 100644
--- a/apps/ecparam.c
+++ b/apps/ecparam.c
@@ -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);
diff --git a/apps/genpkey.c b/apps/genpkey.c
index 0156413..905eb19 100644
--- a/apps/genpkey.c
+++ b/apps/genpkey.c
@@ -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)
diff --git a/apps/nseq.c b/apps/nseq.c
index fd63bd8..4bc4f32 100644
--- a/apps/nseq.c
+++ b/apps/nseq.c
@@ -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)
diff --git a/apps/ocsp.c b/apps/ocsp.c
index 502adf1..e26afe1 100644
--- a/apps/ocsp.c
+++ b/apps/ocsp.c
@@ -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))
diff --git a/apps/pkcs12.c b/apps/pkcs12.c
index 2b9a080..e8df499 100644
--- a/apps/pkcs12.c
+++ b/apps/pkcs12.c
@@ -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) {
diff --git a/apps/pkcs7.c b/apps/pkcs7.c
index 1ed0b01..ad8330d 100644
--- a/apps/pkcs7.c
+++ b/apps/pkcs7.c
@@ -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)
diff --git a/apps/pkcs8.c b/apps/pkcs8.c
index 5db78fc..125bf61 100644
--- a/apps/pkcs8.c
+++ b/apps/pkcs8.c
@@ -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)) {
diff --git a/apps/pkey.c b/apps/pkey.c
index 6f5ecf0..122ced7 100644
--- a/apps/pkey.c
+++ b/apps/pkey.c
@@ -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;
diff --git a/apps/pkeyparam.c b/apps/pkeyparam.c
index abb40d1..d55adef 100644
--- a/apps/pkeyparam.c
+++ b/apps/pkeyparam.c
@@ -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)
diff --git a/apps/pkeyutl.c b/apps/pkeyutl.c
index 5a2827b..8e11777 100644
--- a/apps/pkeyutl.c
+++ b/apps/pkeyutl.c
@@ -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))
diff --git a/apps/req.c b/apps/req.c
index 4900a92..facc639 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -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;
diff --git a/apps/rsa.c b/apps/rsa.c
index 23383d9..5320f38 100644
--- a/apps/rsa.c
+++ b/apps/rsa.c
@@ -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)) {
diff --git a/apps/rsautl.c b/apps/rsautl.c
index f00c2e3..08e4d56 100644
--- a/apps/rsautl.c
+++ b/apps/rsautl.c
@@ -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");
diff --git a/apps/s_client.c b/apps/s_client.c
index ca630f0..9d0b52a 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -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;
diff --git a/apps/s_time.c b/apps/s_time.c
index 6514fb2..fd00148 100644
--- a/apps/s_time.c
+++ b/apps/s_time.c
@@ -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");
diff --git a/apps/sess_id.c b/apps/sess_id.c
index 2be2692..f40f131 100644
--- a/apps/sess_id.c
+++ b/apps/sess_id.c
@@ -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) {
diff --git a/apps/spkac.c b/apps/spkac.c
index 9cbe7fe..07f36d3 100644
--- a/apps/spkac.c
+++ b/apps/spkac.c
@@ -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");
diff --git a/apps/ts.c b/apps/ts.c
index 00b5e53..ee04bb5 100644
--- 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;
 


More information about the openssl-commits mailing list