[openssl] master update

shane.lontis at oracle.com shane.lontis at oracle.com
Wed Jun 17 23:04:45 UTC 2020


The branch master has been updated
       via  b75f08cb13ca2e03946e0beeaac2e0ffa0d2aae7 (commit)
      from  24b6261e5bb286fa494e7208a3de28365e0ca004 (commit)


- Log -----------------------------------------------------------------
commit b75f08cb13ca2e03946e0beeaac2e0ffa0d2aae7
Author: Shane Lontis <shane.lontis at oracle.com>
Date:   Thu Jun 18 09:03:32 2020 +1000

    Fix segfault in openssl app called with no args.
    
    This is a result of removal of interactive mode.
    Redirected it to now use 'openssl help'.
    
    Reviewed-by: Matt Caswell <matt at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/12164)

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

Summary of changes:
 apps/openssl.c                                      |  9 +++++++--
 test/recipes/{04-test_hexstring.t => 20-test_app.t} | 16 +++++++++++++---
 2 files changed, 20 insertions(+), 5 deletions(-)
 copy test/recipes/{04-test_hexstring.t => 20-test_app.t} (58%)

diff --git a/apps/openssl.c b/apps/openssl.c
index 7b0ccbcc09..4c97936824 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -308,6 +308,13 @@ int help_main(int argc, char **argv)
     char *prog;
     HELP_CHOICE o;
     DISPLAY_COLUMNS dc;
+    char *new_argv[3];
+
+    if (argc == 0) {
+        new_argv[0] = "help";
+        new_argv[1] = NULL;
+        return do_cmd(prog_init(), 1, new_argv);
+    }
 
     prog = opt_init(argc, argv, help_options);
     while ((o = opt_next()) != OPT_hEOF) {
@@ -323,8 +330,6 @@ int help_main(int argc, char **argv)
     }
 
     if (opt_num_rest() == 1) {
-        char *new_argv[3];
-
         new_argv[0] = opt_rest()[0];
         new_argv[1] = "--help";
         new_argv[2] = NULL;
diff --git a/test/recipes/04-test_hexstring.t b/test/recipes/20-test_app.t
similarity index 58%
copy from test/recipes/04-test_hexstring.t
copy to test/recipes/20-test_app.t
index 664868fe60..e7246565f2 100644
--- a/test/recipes/04-test_hexstring.t
+++ b/test/recipes/20-test_app.t
@@ -7,9 +7,19 @@
 # https://www.openssl.org/source/license.html
 
 use strict;
+use warnings;
+
 use OpenSSL::Test;
-use OpenSSL::Test::Simple;
 
-setup("test_hexstring");
+setup("test_app");
+
+plan tests => 3;
+
+ok(run(app(["openssl"])),
+   "Run openssl app with no args");
+
+ok(run(app(["openssl", "help"])),
+   "Run openssl app with help");
 
-simple_test("test_hexstring", "hexstr_test");
+ok(!run(app(["openssl", "-help"])),
+   "Run openssl app with incorrect arg");


More information about the openssl-commits mailing list