diff options
author | Werner Koch <[email protected]> | 2015-06-26 10:04:20 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2015-06-26 10:04:20 +0000 |
commit | 0da6afa864cfd68333941d6332d762c82928946c (patch) | |
tree | a3035647b585a04723c2130124e45a12fbf473a4 /src/assuan-buffer.c | |
parent | Fix documentation for assuan_inquire. (diff) | |
download | libassuan-0da6afa864cfd68333941d6332d762c82928946c.tar.gz libassuan-0da6afa864cfd68333941d6332d762c82928946c.zip |
Do not segv if NULL is passed for CTX in sendfd and receivefd.
* src/assuan-buffer.c (assuan_sendfd): Check that CTX is not NULL.
(assuan_receivefd): Ditto.
--
This change is to align the behaviour with that of assuan_send_data.
Suggested-by: Andre Heinecke.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/assuan-buffer.c')
-rw-r--r-- | src/assuan-buffer.c | 6 |
1 files changed, 6 insertions, 0 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 " |