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/sign.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/sign.c')
| -rw-r--r-- | src/sign.c | 8 | 
1 files changed, 8 insertions, 0 deletions
| @@ -393,6 +393,10 @@ gpgme_op_sign_start (gpgme_ctx_t ctx, gpgme_data_t plain, gpgme_data_t sig,    gpg_error_t err;    TRACE_BEG3 (DEBUG_CTX, "gpgme_op_sign_start", ctx,  	      "plain=%p, sig=%p, mode=%i", plain, sig, mode); + +  if (!ctx) +    return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); +    err = sign_start (ctx, 0, plain, sig, mode);    return TRACE_ERR (err);  } @@ -407,6 +411,10 @@ gpgme_op_sign (gpgme_ctx_t ctx, gpgme_data_t plain, gpgme_data_t sig,    TRACE_BEG3 (DEBUG_CTX, "gpgme_op_sign", ctx,  	      "plain=%p, sig=%p, mode=%i", plain, sig, mode); + +  if (!ctx) +    return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); +    err = sign_start (ctx, 1, plain, sig, mode);    if (!err)      err = _gpgme_wait_one (ctx); | 
