Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set a default value for clipboard clipDataId #464

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading