summaryrefslogtreecommitdiffstats
path: root/unix/xserver/hw
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2013-07-01 12:46:45 +0000
committerPierre Ossman <ossman@cendio.se>2013-07-01 12:46:45 +0000
commit749eaa7c689e87492dd1e8991d45c0738c97ac18 (patch)
tree4c560f2cf88865b3eab3a368c50066a489de96fd /unix/xserver/hw
parentf8212b949c462f995ac69a8297dc89defb2b7c64 (diff)
downloadtigervnc-749eaa7c689e87492dd1e8991d45c0738c97ac18.tar.gz
tigervnc-749eaa7c689e87492dd1e8991d45c0738c97ac18.zip
Fix bad size calculation in GetQueryConnect handler as well
as an endian conversion fix. Patch by Christian Steinle. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5124 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/xserver/hw')
-rw-r--r--unix/xserver/hw/vnc/vncExtInit.cc8
1 files 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);