]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dcrypt: Initialize EVP_PKEY when loading JWK key
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 3 Nov 2022 11:44:48 +0000 (13:44 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 3 Nov 2022 13:13:38 +0000 (15:13 +0200)
Satisfies static analysers

src/lib-dcrypt/dcrypt-openssl1.c
src/lib-dcrypt/dcrypt-openssl3.c

index 39528f90d35d265061bb9b7bf828bdaa24e1da2d..6d9ad3a1fdb5cbe994e45e7d11a3f86c93d6883b 100644 (file)
@@ -1852,7 +1852,7 @@ dcrypt_openssl_load_private_key_jwk(struct dcrypt_private_key **key_r,
        const char *error;
        const struct json_tree_node *root, *node;
        struct json_tree *key_tree;
-       EVP_PKEY *pkey;
+       EVP_PKEY *pkey = NULL;
        bool ret;
 
        if (parse_jwk_key(data, &key_tree, &error) != 0) {
@@ -1910,7 +1910,7 @@ dcrypt_openssl_load_public_key_jwk(struct dcrypt_public_key **key_r,
        const char *error;
        const struct json_tree_node *root, *node;
        struct json_tree *key_tree;
-       EVP_PKEY *pkey;
+       EVP_PKEY *pkey = NULL;
        bool ret;
 
        if (parse_jwk_key(data, &key_tree, &error) != 0) {
index 200b1f99a02474ed09bfc57e0844393112e2ba12..b1049616bfa3c1cd136206e99f414852add6c0ef 100644 (file)
@@ -1798,7 +1798,7 @@ dcrypt_openssl_load_private_key_jwk(struct dcrypt_private_key **key_r,
        const char *error;
        const struct json_tree_node *root, *node;
        struct json_tree *key_tree;
-       EVP_PKEY *pkey;
+       EVP_PKEY *pkey = NULL;
        bool ret;
 
        if (parse_jwk_key(data, &key_tree, &error) != 0) {
@@ -1856,7 +1856,7 @@ dcrypt_openssl_load_public_key_jwk(struct dcrypt_public_key **key_r,
        const char *error;
        const struct json_tree_node *root, *node;
        struct json_tree *key_tree;
-       EVP_PKEY *pkey;
+       EVP_PKEY *pkey = NULL;
        bool ret;
 
        if (parse_jwk_key(data, &key_tree, &error) != 0) {