core: Check for nullptr
* src/edit.c (interact_start, edit_start): Return error if key is null. -- This prevents a crash further down the road.
This commit is contained in:
parent
b6593bda1f
commit
6bcfbb3498
@ -127,7 +127,7 @@ interact_start (gpgme_ctx_t ctx, int synchronous, gpgme_key_t key,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (!fnc || !out)
|
||||
if (!key || !fnc || !out)
|
||||
return gpg_error (GPG_ERR_INV_VALUE);
|
||||
|
||||
err = _gpgme_op_data_lookup (ctx, OPDATA_EDIT, &hook, sizeof (*opd), NULL);
|
||||
@ -206,7 +206,7 @@ edit_start (gpgme_ctx_t ctx, int synchronous, int type, gpgme_key_t key,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
if (!fnc || !out)
|
||||
if (!key || !fnc || !out)
|
||||
return gpg_error (GPG_ERR_INV_VALUE);
|
||||
|
||||
err = _gpgme_op_data_lookup (ctx, OPDATA_EDIT, &hook, sizeof (*opd), NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user