aboutsummaryrefslogtreecommitdiffstats
path: root/src/edit.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/edit.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/edit.c')
-rw-r--r--src/edit.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/edit.c b/src/edit.c
index fbdcfdfb..4abf24fa 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -145,6 +145,10 @@ gpgme_op_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
(key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = edit_start (ctx, 0, 0, key, fnc, fnc_value, out);
return err;
}
@@ -163,6 +167,9 @@ gpgme_op_edit (gpgme_ctx_t ctx, gpgme_key_t key,
(key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out);
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = edit_start (ctx, 1, 0, key, fnc, fnc_value, out);
if (!err)
@@ -182,6 +189,10 @@ gpgme_op_card_edit_start (gpgme_ctx_t ctx, gpgme_key_t key,
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
(key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = edit_start (ctx, 0, 1, key, fnc, fnc_value, out);
return err;
}
@@ -199,6 +210,10 @@ gpgme_op_card_edit (gpgme_ctx_t ctx, gpgme_key_t key,
"key=%p (%s), fnc=%p fnc_value=%p, out=%p", key,
(key->subkeys && key->subkeys->fpr) ?
key->subkeys->fpr : "invalid", fnc, fnc_value, out);
+
+ if (!ctx)
+ return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
err = edit_start (ctx, 1, 1, key, fnc, fnc_value, out);
if (!err)
err = _gpgme_wait_one (ctx);