From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVI9W-00081D-HA for qemu-devel@nongnu.org; Tue, 10 Mar 2015 07:16:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YVI9P-0000Ky-F1 for qemu-devel@nongnu.org; Tue, 10 Mar 2015 07:16:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52215) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YVI9P-0000Ki-86 for qemu-devel@nongnu.org; Tue, 10 Mar 2015 07:16:39 -0400 From: Gerd Hoffmann Date: Tue, 10 Mar 2015 12:16:25 +0100 Message-Id: <1425986185-28637-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1425986185-28637-1-git-send-email-kraxel@redhat.com> References: <1425986185-28637-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 3/3] Fix crash when connecting to VNC through websocket List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Jorge=20Acereda=20Maci=C3=A1?= , Gerd Hoffmann , Anthony Liguori From: Jorge Acereda Maci=C3=A1 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 Signed-off-by: Gerd Hoffmann --- ui/vnc-ws.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 *v= s, const char* key) } =20 response =3D 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)= ); =20 g_free(accept); g_free(response); --=20 1.8.3.1