Check context pointers for null pointer on entry points.
[gpgme.git] / src / vfs-create.c
index d7fd24f17943c9e11bb1372fdbf125c4461eb7d3..e8dab4724ead0fb77d7f5c8d722d224b60e95e1b 100644 (file)
@@ -90,6 +90,9 @@ gpgme_op_vfs_transact (gpgme_ctx_t ctx,
                       gpgme_error_t *op_err)
 {
   gpgme_error_t err;
+
+  if (!ctx)
+    return gpg_error (GPG_ERR_INV_VALUE);
   
   err = vfs_start (ctx, 1, command, data_cb, data_cb_value,
                   inq_cb, inq_cb_value, status_cb, status_cb_value);
@@ -178,6 +181,9 @@ gpgme_op_vfs_create (gpgme_ctx_t ctx, gpgme_key_t recp[],
              "container_file=%s, flags=0x%x, op_err=%p",
              container_file, flags, op_err);
 
+  if (!ctx)
+    return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE));
+
   if (_gpgme_debug_trace () && recp)
     {
       int i = 0;