Fully initialise cipher/digest app handles
authorViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 29 Sep 2021 22:03:13 +0000 (18:03 -0400)
committerPauli <pauli@openssl.org>
Fri, 1 Oct 2021 01:04:28 +0000 (11:04 +1000)
This avoids a crash in e.g. `openssl chacha20` as reported by
Steffen Nurpmeso on openssl-users.

Resolves: #16713

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16714)

(cherry picked from commit a8cc0efe0d8fdd7bfa1d40b3c008d7d6ddf970db)

apps/openssl.c

index 30e1e755e0148ccefa557ea4abe1239c54589d77..2693350ffc941bec58147973462c18d1212e1cfa 100644 (file)
@@ -395,6 +395,7 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[])
 
     if (argc <= 0 || argv[0] == NULL)
         return 0;
+    memset(&f, 0, sizeof(f));
     f.name = argv[0];
     fp = lh_FUNCTION_retrieve(prog, &f);
     if (fp == NULL) {