Fix 2 compiler warnings.

* dirmngr/loadswdb.c: Set ERR on malloc failure.
* g10/passphrase.c (passphrase_to_dek): Initialize all fields of
HELP_S2K.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2016-12-08 19:02:56 +01:00
parent 4a04277ad1
commit cb4c7abb77
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
2 changed files with 5 additions and 2 deletions

View File

@ -272,7 +272,10 @@ dirmngr_load_swdb (ctrl_t ctrl, int force)
/* Create the filename of the file with the keys. */
keyfile_fname = make_filename_try (gnupg_datadir (), "distsigkey.gpg", NULL);
if (!keyfile_fname)
goto leave;
{
err = gpg_error_from_syserror ();
goto leave;
}
/* Fetch the swdb from the web. */
err = fetch_file (ctrl, "https://versions.gnupg.org/swdb.lst", &swdb);

View File

@ -319,8 +319,8 @@ passphrase_to_dek (int cipher_algo, STRING2KEY *s2k,
log_assert (create && !nocache);
/* This is used for the old rfc1991 mode
* Note: This must match the code in encode.c with opt.rfc1991 set */
memset (&help_s2k, 0, sizeof (help_s2k));
s2k = &help_s2k;
s2k->mode = 0;
s2k->hash_algo = S2K_DIGEST_ALGO;
}