From b34add3fe438a693e236a835135bd11b4e177daa Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Thu, 26 May 2011 16:01:26 +0200 Subject: Check context pointers for null pointer on entry points. --- src/gpgconf.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/gpgconf.c') diff --git a/src/gpgconf.c b/src/gpgconf.c index 3c9d16b5..f3411d51 100644 --- a/src/gpgconf.c +++ b/src/gpgconf.c @@ -94,8 +94,12 @@ gpgme_op_conf_load (gpgme_ctx_t ctx, gpgme_conf_comp_t *conf_p) { #ifdef ENABLE_GPGCONF gpgme_error_t err; - gpgme_protocol_t proto = ctx->protocol; + gpgme_protocol_t proto; + if (!ctx) + return gpg_error (GPG_ERR_INV_VALUE); + + proto = ctx->protocol; ctx->protocol = GPGME_PROTOCOL_GPGCONF; err = _gpgme_op_reset (ctx, 1); if (err) @@ -116,8 +120,12 @@ gpgme_op_conf_save (gpgme_ctx_t ctx, gpgme_conf_comp_t comp) { #ifdef ENABLE_GPGCONF gpgme_error_t err; - gpgme_protocol_t proto = ctx->protocol; + gpgme_protocol_t proto; + + if (!ctx) + return gpg_error (GPG_ERR_INV_VALUE); + proto = ctx->protocol; ctx->protocol = GPGME_PROTOCOL_GPGCONF; err = _gpgme_op_reset (ctx, 1); if (err) -- cgit v1.2.3