Skip to content

Commit

Permalink
Send 1 byte over clipboard max to trigger reject
Browse files Browse the repository at this point in the history
If vmside clipboard is over the maximum limit, sending one byte over
maximum limit should trigger inter-vm clipboard rejection instead of
truncation.

Supplements: QubesOS/qubes-issues#9296
  • Loading branch information
alimirjamali committed Oct 6, 2024
1 parent bc2f589 commit e04883e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gui-agent/vmside.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,9 @@ static void send_clipboard_data(libvchan_t *vchan, XID window, char *data, uint3
hdr.window = window;
if (len > MAX_CLIPBOARD_SIZE)
{
len = MAX_CLIPBOARD_SIZE;
// send one byte over the Maximum limit. A sign for xside to reject it.
// also anything over clipboard_buffer_size will be rejected with a warning.
len = MAX_CLIPBOARD_SIZE + 1;
}
hdr.untrusted_len = len;
write_struct(vchan, hdr);
Expand Down

0 comments on commit e04883e

Please sign in to comment.