aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRui Abreu Ferreira <raf-ep@gmx.com>2014-11-05 19:49:03 +0000
committerThiago de Arruda <tpadilha84@gmail.com>2014-11-07 13:43:32 -0300
commit4e880f3f0058dce4a2a8d6fafeee2d89fad291d3 (patch)
tree8fcf43d4559a0dff5e69598827d6d6a9de332853 /src
parent2729ad195b5dd6a12d57c782739726c4b74f780e (diff)
downloadrneovim-4e880f3f0058dce4a2a8d6fafeee2d89fad291d3.tar.gz
rneovim-4e880f3f0058dce4a2a8d6fafeee2d89fad291d3.tar.bz2
rneovim-4e880f3f0058dce4a2a8d6fafeee2d89fad291d3.zip
msgpack-rpc: Close channel on invalid msgpack RPC
- When an invalid msgpack RPC msg is received from a channel we now close that channel all calls on that channel fail with an error message.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/msgpack_rpc/channel.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/nvim/msgpack_rpc/channel.c b/src/nvim/msgpack_rpc/channel.c
index 3ab868998c..aa6008558f 100644
--- a/src/nvim/msgpack_rpc/channel.c
+++ b/src/nvim/msgpack_rpc/channel.c
@@ -436,6 +436,11 @@ static void handle_request(Channel *channel, msgpack_object *request)
&error,
NIL,
&out_buffer));
+ char buf[256];
+ snprintf(buf, sizeof(buf),
+ "Channel %" PRIu64 " sent an invalid message, closing.",
+ channel->id);
+ call_set_error(channel, buf);
return;
}