Skip to content

Commit 4d65ec4

Browse files
committed
tightvnc-filetransfer: fix file upload for 64-bit systems
Before, the server would read more than the actually sent 4 byte time stamp, missing the next message's header and in turn treating message payload as header data.
1 parent b7195ce commit 4d65ec4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libvncserver/tightvnc-filetransfer/handlefiletransferrequest.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,7 @@ HandleFileUploadDataRequest(rfbClientPtr cl, rfbTightClientPtr rtcp)
809809
msg.fud.realSize = Swap16IfLE(msg.fud.realSize);
810810
msg.fud.compressedSize = Swap16IfLE(msg.fud.compressedSize);
811811
if((msg.fud.realSize == 0) && (msg.fud.compressedSize == 0)) {
812-
if((n = rfbReadExact(cl, (char*)&(rtcp->rcft.rcfu.mTime), sizeof(unsigned
813-
long))) <= 0) {
812+
if((n = rfbReadExact(cl, (char*)&(rtcp->rcft.rcfu.mTime), 4)) <= 0) {
814813

815814
if (n < 0)
816815
rfbLog("File [%s]: Method [%s]: Error while reading FileUploadRequestMsg\n",

0 commit comments

Comments
 (0)