Home GnuPG
Diffusion GPGME 343d3e2232a2

core: Do not clobber R_KEY in gpgme_get_key on error.

Description

core: Do not clobber R_KEY in gpgme_get_key on error.

* src/keylist.c (gpgme_get_key): Assign a value to the return
parameter only on success.

This problem could be triggered by an ambiguous key. The problem is
that the key returned in that case is for one not expected and worse
it has not been ref-ed.

  • Signed-off-by: Werner Koch <wk@gnupg.org>

Details

Provenance
wernerAuthored on Mar 20 2018, 10:41 AM
Parents
rM9e1e6554834d: core: Fix ABI regression in recent commit.
Branches
Unknown
Tags
Unknown