summaryrefslogtreecommitdiffstats
path: root/apps/openssl.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2011-03-19 09:47:47 +0000
committerRichard Levitte <levitte@openssl.org>2011-03-19 09:47:47 +0000
commit01d2e27a2badb0a01706fe58738df67cc7e90b9c (patch)
tree4210b520add8e3ea3f9580ab7c94f10b3402ed1d /apps/openssl.c
parentdd7aadf7b2db65de2ec1eca6e598d07864d3ace4 (diff)
Apply all the changes submitted by Steven M. Schweda <sms@antinode.info>
Diffstat (limited to 'apps/openssl.c')
-rw-r--r--apps/openssl.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/apps/openssl.c b/apps/openssl.c
index 851e639735..7dbb7ac32a 100644
--- a/apps/openssl.c
+++ b/apps/openssl.c
@@ -410,7 +410,33 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
}
if (fp != NULL)
{
+#if defined( OPENSSL_SYS_VMS) && !defined( VMS_TRUST_ARGV)
+ /* 2011-03-08 SMS.
+ * "HP C V7.3-009 on OpenVMS Alpha V8.3" with 64-bit
+ * pointers (at least) may not NULL-terminate argv[]
+ * as expected. If necessary, use a (properly)
+ * NULL-terminated duplicate of argv[].
+ */
+ char **argv2 = NULL;
+
+ if (argv[ argc] != NULL)
+ {
+ argv2 = OPENSSL_malloc( (argc+ 1)* sizeof( char *));
+ if (argv2 == NULL)
+ { ret = -1; goto end; }
+ memcpy( argv2, argv, (argc* sizeof( char *)));
+ argv2[ argc] = NULL;
+ argv = argv2;
+ }
+#endif
ret=fp->func(argc,argv);
+#if defined( OPENSSL_SYS_VMS) && !defined( VMS_TRUST_ARGV)
+ /* Free any duplicate argv[] storage. */
+ if (argv2 != NULL)
+ {
+ OPENSSL_free( argv2);
+ }
+#endif
}
else if ((strncmp(argv[0],"no-",3)) == 0)
{