Skip to content

Commit

Permalink
tightvnc-filetransfer: fix file upload for 64-bit systems
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bk138 committed Aug 4, 2020
1 parent b7195ce commit 4d65ec4
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -809,8 +809,7 @@ HandleFileUploadDataRequest(rfbClientPtr cl, rfbTightClientPtr rtcp)
msg.fud.realSize = Swap16IfLE(msg.fud.realSize);
msg.fud.compressedSize = Swap16IfLE(msg.fud.compressedSize);
if((msg.fud.realSize == 0) && (msg.fud.compressedSize == 0)) {
if((n = rfbReadExact(cl, (char*)&(rtcp->rcft.rcfu.mTime), sizeof(unsigned
long))) <= 0) {
if((n = rfbReadExact(cl, (char*)&(rtcp->rcft.rcfu.mTime), 4)) <= 0) {

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

0 comments on commit 4d65ec4

Please sign in to comment.