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/edit.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/edit.c')
| -rw-r--r-- | src/edit.c | 15 | 
1 files changed, 15 insertions, 0 deletions
| @@ -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); | 
