diff mbox

[v2] Fix crash when connecting to VNC through websocket

Message ID 8A3EBB15-2138-4AC6-92B7-B0DA9825225A@gmail.com
State New
Headers show

Commit Message

Jorge Acereda MaciĆ” Feb. 25, 2015, 11:21 p.m. UTC
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>

---
 ui/vnc-ws.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Gerd Hoffmann Feb. 26, 2015, 6:38 a.m. UTC | #1
On Do, 2015-02-26 at 00:21 +0100, Jorge Acereda MaciĆ” wrote:
> 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).

Patch updated.

thanks,
  Gerd
diff mbox

Patch

diff --git a/ui/vnc-ws.c b/ui/vnc-ws.c
index e304baf..d75950d 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);