mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-28 10:52:02 +00:00
[client] spice: validate clipboard responses
This commit is contained in:
@@ -563,6 +563,9 @@ static const struct wl_data_source_listener dataSourceListener = {
|
||||
static void waylandCBReplyFn(void * opaque, LG_ClipboardData type,
|
||||
uint8_t * data, uint32_t size)
|
||||
{
|
||||
if (type == LG_CLIPBOARD_DATA_NONE)
|
||||
return;
|
||||
|
||||
struct WCBTransfer * transfer = malloc(sizeof(*transfer));
|
||||
if (!transfer)
|
||||
{
|
||||
|
||||
@@ -135,15 +135,18 @@ static void x11CBReplyFn(void * opaque, LG_ClipboardData type,
|
||||
{
|
||||
XEvent *s = (XEvent *)opaque;
|
||||
|
||||
XChangeProperty(
|
||||
x11.display ,
|
||||
s->xselection.requestor,
|
||||
s->xselection.property ,
|
||||
s->xselection.target ,
|
||||
8,
|
||||
PropModeReplace,
|
||||
data,
|
||||
size);
|
||||
if (type == LG_CLIPBOARD_DATA_NONE)
|
||||
s->xselection.property = None;
|
||||
else
|
||||
XChangeProperty(
|
||||
x11.display ,
|
||||
s->xselection.requestor,
|
||||
s->xselection.property ,
|
||||
s->xselection.target ,
|
||||
8,
|
||||
PropModeReplace,
|
||||
data,
|
||||
size);
|
||||
|
||||
XSendEvent(x11.display, s->xselection.requestor, 0, 0, s);
|
||||
XFlush(x11.display);
|
||||
|
||||
Reference in New Issue
Block a user