From ef7b7e91600f35b4d682a6267001a8d30f0fa49f Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Wed, 23 Dec 2015 15:16:02 +0100 Subject: [PATCH] gpg: Fix use of assert from commit dc417bf0. * g10/keydb.c (keydb_update_keyblock): De-ref after the assert. Use %zu for size_t. Signed-off-by: Werner Koch --- g10/keydb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/g10/keydb.c b/g10/keydb.c index fb4966c27..2150a927a 100644 --- a/g10/keydb.c +++ b/g10/keydb.c @@ -1386,12 +1386,13 @@ gpg_error_t keydb_update_keyblock (KEYDB_HANDLE hd, kbnode_t kb) { gpg_error_t err; - PKT_public_key *pk = kb->pkt->pkt.public_key; + PKT_public_key *pk; KEYDB_SEARCH_DESC desc; size_t len; assert (kb); assert (kb->pkt->pkttype == PKT_PUBLIC_KEY); + pk = kb->pkt->pkt.public_key; if (!hd) return gpg_error (GPG_ERR_INV_ARG); @@ -1411,7 +1412,7 @@ keydb_update_keyblock (KEYDB_HANDLE hd, kbnode_t kb) if (len == 20) desc.mode = KEYDB_SEARCH_MODE_FPR20; else - log_bug ("%s: Unsupported key length: %zd\n", __func__, len); + log_bug ("%s: Unsupported key length: %zu\n", __func__, len); keydb_search_reset (hd); err = keydb_search (hd, &desc, 1, NULL);