summaryrefslogtreecommitdiff
authorMarc-André Lureau <marcandre.lureau@gmail.com>2014-06-25 12:36:03 (GMT)
committer Marc-André Lureau <marcandre.lureau@gmail.com>2014-07-25 15:25:29 (GMT)
commit3c25192ee90f843a2f84ff99d119b1cb45979bac (patch) (side-by-side diff)
tree12bd20d8151ba168e6037c1d8069eceb90e689b8
parent284cca2a5ebc98257275585083321a7100fb89b3 (diff)
downloadspice-master.zip
spice-master.tar.gz
server: don't assert on invalid client messageHEADmaster
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
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--server/snd_worker.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/snd_worker.c b/server/snd_worker.c
index 7d52ded..70148b7 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) {