Skip to content

Commit

Permalink
Merge pull request #464 from luciaprime54/fix/xfreerdp-missing-clipDa…
Browse files Browse the repository at this point in the history
…taId

Set a default value for clipboard clipDataId
  • Loading branch information
obilodeau committed Jan 15, 2024
2 parents 9994d65 + ebb6222 commit ccb0698
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pyrdp/parser/rdp/virtual_channel/clipboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ def parseFileContentsRequest(self, payload, msgFlags):
posLo = Uint32LE.unpack(stream)
posHi = Uint32LE.unpack(stream)
cbRequested = Uint32LE.unpack(stream)
clipDataId = Uint32LE.unpack(stream)
# xfreeRDP (and maybe other non-Windows clients?) don't send a clipDataId.
# Currently we don't use clipDataId for anything, so we can safely just set it to 0.
try:
clipDataId = Uint32LE.unpack(stream)
except ValueError:
clipDataId = 0

pos = posHi << 32 | posLo
return FileContentsRequestPDU(payload, streamId, lindex, msgFlags, dwFlags, pos, cbRequested, clipDataId)
Expand Down

0 comments on commit ccb0698

Please sign in to comment.