diff options
Diffstat (limited to 'src/op-support.c')
-rw-r--r-- | src/op-support.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/op-support.c b/src/op-support.c index 0a5639be..000560bb 100644 --- a/src/op-support.c +++ b/src/op-support.c @@ -37,7 +37,12 @@ gpgme_error_t _gpgme_op_data_lookup (gpgme_ctx_t ctx, ctx_op_data_id_t type, void **hook, int size, void (*cleanup) (void *)) { - struct ctx_op_data *data = ctx->op_data; + struct ctx_op_data *data; + + if (!ctx) + return gpg_error (GPG_ERR_INV_VALUE); + + data = ctx->op_data; while (data && data->type != type) data = data->next; if (!data) |