summaryrefslogtreecommitdiff
path: root/apps/openssl.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-06-18 09:03:32 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-06-18 09:03:32 +1000
commitb75f08cb13ca2e03946e0beeaac2e0ffa0d2aae7 (patch)
tree8d2a5b136768ff2ce36e3afe621fc62c6a282afa /apps/openssl.c
parent24b6261e5bb286fa494e7208a3de28365e0ca004 (diff)
downloadopenssl-new-b75f08cb13ca2e03946e0beeaac2e0ffa0d2aae7.tar.gz
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@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12164)
Diffstat (limited to 'apps/openssl.c')
-rw-r--r--apps/openssl.c9
1 files changed, 7 insertions, 2 deletions
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;