aboutsummaryrefslogtreecommitdiffstats
path: root/src/keylist.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2011-05-26 14:01:26 +0000
committerMarcus Brinkmann <[email protected]>2011-05-26 14:01:26 +0000
commitb34add3fe438a693e236a835135bd11b4e177daa (patch)
tree8b66e12d5c62112f33d244340b96638ac30454d8 /src/keylist.c
parentFix I/O callback example. (diff)
downloadgpgme-b34add3fe438a693e236a835135bd11b4e177daa.tar.gz
gpgme-b34add3fe438a693e236a835135bd11b4e177daa.zip
Check context pointers for null pointer on entry points.
Diffstat (limited to 'src/keylist.c')
-rw-r--r--src/keylist.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/keylist.c b/src/keylist.c
index 8f61a261..29e30a0f 100644
--- a/src/keylist.c
+++ b/src/keylist.c
@@ -863,6 +863,9 @@ gpgme_op_keylist_start (gpgme_ctx_t ctx, const char *pattern, int secret_only)
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_keylist_start", ctx,
"pattern=%s, secret_only=%i", pattern, secret_only);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = _gpgme_op_reset (ctx, 2);
if (err)
return TRACE_ERR (err);
@@ -900,6 +903,9 @@ gpgme_op_keylist_ext_start (gpgme_ctx_t ctx, const char *pattern[],
TRACE_BEG2 (DEBUG_CTX, "gpgme_op_keylist_ext_start", ctx,
"secret_only=%i, reserved=0x%x", secret_only, reserved);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = _gpgme_op_reset (ctx, 2);
if (err)
return TRACE_ERR (err);