aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/assuan-buffer.c6
-rw-r--r--src/context.c4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/assuan-buffer.c b/src/assuan-buffer.c
index 04aff5a..b442b3d 100644
--- a/src/assuan-buffer.c
+++ b/src/assuan-buffer.c
@@ -524,6 +524,9 @@ assuan_sendfd (assuan_context_t ctx, assuan_fd_t fd)
return _assuan_error (ctx, GPG_ERR_NOT_IMPLEMENTED);
#endif
+ if (!ctx)
+ return _assuan_error (ctx, GPG_ERR_ASS_INV_VALUE);
+
if (! ctx->engine.sendfd)
return set_error (ctx, GPG_ERR_NOT_IMPLEMENTED,
"server does not support sending and receiving "
@@ -534,6 +537,9 @@ assuan_sendfd (assuan_context_t ctx, assuan_fd_t fd)
gpg_error_t
assuan_receivefd (assuan_context_t ctx, assuan_fd_t *fd)
{
+ if (!ctx)
+ return _assuan_error (ctx, GPG_ERR_ASS_INV_VALUE);
+
if (! ctx->engine.receivefd)
return set_error (ctx, GPG_ERR_NOT_IMPLEMENTED,
"server does not support sending and receiving "
diff --git a/src/context.c b/src/context.c
index 62b7f57..147edae 100644
--- a/src/context.c
+++ b/src/context.c
@@ -183,8 +183,8 @@ void assuan_set_io_monitor (assuan_context_t ctx,
/* Store the error in the context so that the error sending function
- can take out a descriptive text. Inside the assuan code, use the
- macro set_error instead of this function. */
+ can take out a descriptive text. Inside the assuan code, use the
+ macro set_error instead of this function. */
gpg_error_t
assuan_set_error (assuan_context_t ctx, gpg_error_t err, const char *text)
{