From ecb957b0037440b608e32a893be09c93db97ad50 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 1 Jul 2013 12:48:31 +0000 Subject: [PATCH] Copy r5124 from trunk. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/1_3@5125 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- unix/xserver/hw/vnc/vncExtInit.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/unix/xserver/hw/vnc/vncExtInit.cc b/unix/xserver/hw/vnc/vncExtInit.cc index 7fad77d0..7148486d 100644 --- a/unix/xserver/hw/vnc/vncExtInit.cc +++ b/unix/xserver/hw/vnc/vncExtInit.cc @@ -1025,21 +1025,23 @@ static int ProcVncExtGetQueryConnect(ClientPtr client) rep.addrLen = qcTimeout ? strlen(qcAddress) : 0; rep.userLen = qcTimeout ? strlen(qcUsername) : 0; rep.opaqueId = (CARD32)(long)queryConnectId; - rep.length = (rep.userLen + rep.addrLen + 3) >> 2; + rep.length = ((rep.userLen + 3) >> 2) + ((rep.addrLen + 3) >> 2); if (client->swapped) { #if XORG < 112 int n; swaps(&rep.sequenceNumber, n); - swapl(&rep.userLen, n); swapl(&rep.addrLen, n); + swapl(&rep.userLen, n); swapl(&rep.timeout, n); swapl(&rep.opaqueId, n); + swapl(&rep.length, n); #else swaps(&rep.sequenceNumber); - swapl(&rep.userLen); swapl(&rep.addrLen); + swapl(&rep.userLen); swapl(&rep.timeout); swapl(&rep.opaqueId); + swapl(&rep.length); #endif } WriteToClient(client, sizeof(xVncExtGetQueryConnectReply), (char *)&rep); -- 2.39.5