From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=53368 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OOlr1-0001u1-RT for qemu-devel@nongnu.org; Wed, 16 Jun 2010 02:12:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OOlqx-00033G-EB for qemu-devel@nongnu.org; Wed, 16 Jun 2010 02:12:03 -0400 Received: from iksaif.net ([88.191.73.63]:35962) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OOlqx-00032z-74 for qemu-devel@nongnu.org; Wed, 16 Jun 2010 02:11:59 -0400 From: Corentin Chary Date: Wed, 16 Jun 2010 09:12:12 +0200 Message-Id: <1276672333-14831-16-git-send-email-corentincj@iksaif.net> In-Reply-To: <1276672333-14831-1-git-send-email-corentincj@iksaif.net> References: <1276672333-14831-1-git-send-email-corentincj@iksaif.net> Subject: [Qemu-devel] [PATCH 15/16] vnc: add missing lock for vnc_cursor_define() List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Corentin Chary , Anthony Liguori , Alexander Graf All vnc_write() calls must be locked (except the ones present before the protocol initialization). Signed-off-by: Corentin Chary --- ui/vnc.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index cffe238..61f9a05 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -794,6 +794,7 @@ static int vnc_cursor_define(VncState *vs) int isize; if (vnc_has_feature(vs, VNC_FEATURE_RICH_CURSOR)) { + vnc_lock_output(vs); vnc_write_u8(vs, VNC_MSG_SERVER_FRAMEBUFFER_UPDATE); vnc_write_u8(vs, 0); /* padding */ vnc_write_u16(vs, 1); /* # of rects */ @@ -802,6 +803,7 @@ static int vnc_cursor_define(VncState *vs) isize = c->width * c->height * vs->clientds.pf.bytes_per_pixel; vnc_write_pixels_generic(vs, &pf, c->data, isize); vnc_write(vs, vs->vd->cursor_mask, vs->vd->cursor_msize); + vnc_unlock_output(vs); return 0; } return -1; -- 1.7.1