Fix potential crash in trace macro.
* src/signers.c (gpgme_signers_add): Avoid deref of a NULL KEY in the trace macro. * src/engine-spawn.c (engspawn_release): Remove always true condition. * src/engine-gpg.c (gpg_release): Ditto. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
119f27032b
commit
8cfcdfe556
@ -396,7 +396,6 @@ gpg_release (void *engine)
|
|||||||
{
|
{
|
||||||
struct arg_and_data_s *next = gpg->arglist->next;
|
struct arg_and_data_s *next = gpg->arglist->next;
|
||||||
|
|
||||||
if (gpg->arglist)
|
|
||||||
free (gpg->arglist);
|
free (gpg->arglist);
|
||||||
gpg->arglist = next;
|
gpg->arglist = next;
|
||||||
}
|
}
|
||||||
|
@ -355,7 +355,6 @@ engspawn_release (void *engine)
|
|||||||
{
|
{
|
||||||
struct datalist_s *next = esp->arglist->next;
|
struct datalist_s *next = esp->arglist->next;
|
||||||
|
|
||||||
if (esp->arglist)
|
|
||||||
free (esp->arglist);
|
free (esp->arglist);
|
||||||
esp->arglist = next;
|
esp->arglist = next;
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ gpgme_error_t
|
|||||||
gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key)
|
gpgme_signers_add (gpgme_ctx_t ctx, const gpgme_key_t key)
|
||||||
{
|
{
|
||||||
TRACE_BEG2 (DEBUG_CTX, "gpgme_signers_add", ctx,
|
TRACE_BEG2 (DEBUG_CTX, "gpgme_signers_add", ctx,
|
||||||
"key=%p (%s)", key, (key->subkeys && key->subkeys->fpr) ?
|
"key=%p (%s)", key, (key && key->subkeys && key->subkeys->fpr) ?
|
||||||
key->subkeys->fpr : "invalid");
|
key->subkeys->fpr : "invalid");
|
||||||
|
|
||||||
if (!ctx || !key)
|
if (!ctx || !key)
|
||||||
|
Loading…
Reference in New Issue
Block a user