1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

gpg: Avoid warnings about possible NULL deref.

* g10/getkey.c (cache_public_key): Protect deref of CE which actually
can't happen.
* g10/keygen.c (quickgen_set_para): s/sprintf/snprintf/.
* g10/tofu.c (end_transaction, rollback_transaction): Allow NULL for
DB.
* g10/trustdb.c (update_min_ownertrust): Remove useless clearling of
ERR.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2016-01-07 19:05:35 +01:00
parent 008aa6e6d4
commit 8a56a38387
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
4 changed files with 8 additions and 3 deletions

View file

@ -196,7 +196,7 @@ cache_public_key (PKT_public_key * pk)
/* Remove the last 50% of the entries. */
for (ce = pk_cache, n = 0; ce && n < pk_cache_entries/2; n++)
ce = ce->next;
if (ce != pk_cache && ce->next)
if (ce && ce != pk_cache && ce->next)
{
ce2 = ce->next;
ce->next = NULL;