diff options
author | Marcus Brinkmann <[email protected]> | 2011-05-26 14:01:26 +0000 |
---|---|---|
committer | Marcus Brinkmann <[email protected]> | 2011-05-26 14:01:26 +0000 |
commit | b34add3fe438a693e236a835135bd11b4e177daa (patch) | |
tree | 8b66e12d5c62112f33d244340b96638ac30454d8 /src/op-support.c | |
parent | Fix I/O callback example. (diff) | |
download | gpgme-b34add3fe438a693e236a835135bd11b4e177daa.tar.gz gpgme-b34add3fe438a693e236a835135bd11b4e177daa.zip |
Check context pointers for null pointer on entry points.
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) |