summaryrefslogtreecommitdiff
path: root/ui/vnc-ws.c
diff options
context:
space:
mode:
authorJorge Acereda MaciĆ” <jacereda@gmail.com>2015-02-26 00:21:39 +0100
committerGerd Hoffmann <kraxel@redhat.com>2015-03-10 11:33:42 +0100
commitb57489cfe48f9fedc10205c0494f144085733f30 (patch)
tree5d856b4c041a31051eae5c768717053c640c61d1 /ui/vnc-ws.c
parent006decd448ae3ce04f12e2bbdd3079ba74d25c89 (diff)
downloadqemu-b57489cfe48f9fedc10205c0494f144085733f30.tar.gz
Fix crash when connecting to VNC through websocket
Connecting to VNC through websocket crashes in vnc_flush() when trying to acquire a mutex that hasn't been initialized (vnc_init_state(vs) hasn't been called at this point). Signed-off-by: Jorge Acereda Macia <jacereda@gmail.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/vnc-ws.c')
-rw-r--r--ui/vnc-ws.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c
index e304bafeb0..d75950d7b1 100644
--- a/ui/vnc-ws.c
+++ b/ui/vnc-ws.c
@@ -207,8 +207,7 @@ static void vncws_send_handshake_response(VncState *vs, const char* key)
}
response = g_strdup_printf(WS_HANDSHAKE, accept);
- vnc_write(vs, response, strlen(response));
- vnc_flush(vs);
+ vnc_client_write_buf(vs, (const uint8_t *)response, strlen(response));
g_free(accept);
g_free(response);