g10: Fix crash.
authorJustus Winter <justus@g10code.com>
Mon, 7 Nov 2016 11:53:17 +0000 (12:53 +0100)
committerJustus Winter <justus@g10code.com>
Mon, 7 Nov 2016 11:57:30 +0000 (12:57 +0100)
commit5840353d8bbcd9e75374f3bdb2547ffa7bbea897
tree47b55ec620e07c7e01df5aa8b8387e0d4edb62e9
parent4d7dc432b598d7d28d6caba78a94d12034134b96
g10: Fix crash.

* g10/getkey.c (get_best_pubkey_byname): If 'get_pubkey_byname' does
not return a getkey context, then it can return at most one key,
therefore there is nothing to rank.  Also, always initialize '*retctx'
to be on the safe side.

GnuPG-bug-id: 2828
Fixes: ab89164be02012f1bf159c971853b8610e966301
Signed-off-by: Justus Winter <justus@g10code.com>
g10/getkey.c