From 66a0091d74768ab3a4a5342d3645e1834c59045a Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 27 Oct 2016 14:43:29 +0200 Subject: [PATCH] g10: Assert preconditions. * g10/getkey.c (get_pubkey_byname): Assert preconditions. Signed-off-by: Justus Winter --- g10/getkey.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/g10/getkey.c b/g10/getkey.c index 7b1c22bd8..22842fe96 100644 --- a/g10/getkey.c +++ b/g10/getkey.c @@ -1203,6 +1203,9 @@ get_pubkey_byname (ctrl_t ctrl, GETKEY_CTX * retctx, PKT_public_key * pk, int nodefault = 0; int anylocalfirst = 0; + /* If RETCTX is not NULL, then RET_KDBHD must be NULL. */ + log_assert (retctx == NULL || ret_kdbhd == NULL); + if (retctx) *retctx = NULL;