Skip to content

Commit

Permalink
lib-dcrypt: Fix uninitialized memory
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse authored and sirainen committed Oct 17, 2016
1 parent 0e82875 commit 54b9c83
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib-dcrypt/dcrypt-openssl.c
Expand Up @@ -729,6 +729,7 @@ static
bool dcrypt_openssl_generate_keypair(struct dcrypt_keypair *pair_r, enum dcrypt_key_type kind, unsigned int bits, const char *curve, const char **error_r)
{
EVP_PKEY *pkey = NULL;
memset(pair_r, 0, sizeof(struct dcrypt_keypair));
if (kind == DCRYPT_KEY_RSA) {
if (dcrypt_openssl_generate_rsa_key(bits, &pkey, error_r)) {
pair_r->priv = i_new(struct dcrypt_private_key, 1);
Expand Down
1 change: 1 addition & 0 deletions src/lib-dcrypt/test-crypto.c
Expand Up @@ -636,6 +636,7 @@ void test_get_info_pw_encrypted(void) {
test_begin("test_get_info_pw_encrypted");

struct dcrypt_keypair p1;
memset(&p1, 0, sizeof(p1));
const char *error;
bool ret = dcrypt_keypair_generate(&p1, DCRYPT_KEY_EC, 0, "sect571k1", &error);
test_assert(ret == TRUE);
Expand Down

0 comments on commit 54b9c83

Please sign in to comment.