diff options
author | Marc-André Lureau <marcandre.lureau@gmail.com> | 2014-06-25 14:36:03 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@gmail.com> | 2014-07-25 17:25:29 +0200 |
commit | 3c25192ee90f843a2f84ff99d119b1cb45979bac (patch) | |
tree | 12bd20d8151ba168e6037c1d8069eceb90e689b8 | |
parent | 284cca2a5ebc98257275585083321a7100fb89b3 (diff) | |
download | spice-3c25192ee90f843a2f84ff99d119b1cb45979bac.tar.gz spice-3c25192ee90f843a2f84ff99d119b1cb45979bac.tar.xz spice-3c25192ee90f843a2f84ff99d119b1cb45979bac.zip |
server: don't assert on invalid client message
Some users have been reaching this error:
snd_receive: ASSERT n failed
A misbehaving client could easily hit that condition by sending too big
messages. Instead of assert(), replace with a warning. When a message
too big to fit is received, it will simply disconnect the channel.
https://bugzilla.redhat.com/show_bug.cgi?id=962187
-rw-r--r-- | server/snd_worker.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/snd_worker.c b/server/snd_worker.c index 7d52dede..70148b76 100644 --- a/server/snd_worker.c +++ b/server/snd_worker.c @@ -421,7 +421,7 @@ static void snd_receive(void* data) for (;;) { ssize_t n; n = channel->receive_data.end - channel->receive_data.now; - spice_assert(n); + spice_warn_if(n <= 0); n = reds_stream_read(channel->stream, channel->receive_data.now, n); if (n <= 0) { if (n == 0) { |