Skip to content

Commit

Permalink
Set a default value for clipboard clipDataId, to handle non-windows c…
Browse files Browse the repository at this point in the history
…lients like xfreeRDP
  • Loading branch information
luciaprime54 committed Jan 15, 2024
1 parent 9994d65 commit ebb6222
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 ebb6222

Please sign in to comment.