From c0b2c8e655c77beea3fada266eb3be72c4865bbf Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 21 Dec 2017 01:56:59 +1100 Subject: [PATCH] [client] added missing wait to cursor update thread --- client/main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/main.c b/client/main.c index 46373d48..94faf170 100644 --- a/client/main.c +++ b/client/main.c @@ -185,6 +185,13 @@ int cursorThread(void * unused) while(state.running) { + // poll until we have cursor data + if(!(state.shm->flags & KVMFR_HEADER_FLAG_CURSOR)) + { + nsleep(100); + continue; + } + // we must take a copy of the header, both to let the guest advance and to // prevent the contained arguments being abused to overflow buffers memcpy(&header, (KVMFRHeader *)state.shm, sizeof(struct KVMFRHeader));