42 lines
1.6 KiB
Diff
42 lines
1.6 KiB
Diff
|
|
From 5dc2ba3fa793407b1dd6ee1920808a729990abf7 Mon Sep 17 00:00:00 2001
|
||
|
|
From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= <berrange@redhat.com>
|
||
|
|
Date: Mon, 15 Jan 2024 09:51:19 +0000
|
||
|
|
Subject: [PATCH] ui: reject extended clipboard message if not activated
|
||
|
|
MIME-Version: 1.0
|
||
|
|
Content-Type: text/plain; charset=UTF-8
|
||
|
|
Content-Transfer-Encoding: 8bit
|
||
|
|
|
||
|
|
The extended clipboard message protocol requires that the client
|
||
|
|
activate the extension by requesting a psuedo encoding. If this
|
||
|
|
is not done, then any extended clipboard messages from the client
|
||
|
|
should be considered invalid and the client dropped.
|
||
|
|
|
||
|
|
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
|
||
|
|
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
||
|
|
Message-Id: <20240115095119.654271-1-berrange@redhat.com>
|
||
|
|
(cherry picked from commit 4cba8388968b70fe20e290221dc421c717051fdd)
|
||
|
|
Signed-off-by: zhujun2 <zhujun2_yewu@cmss.chinamobile.com>
|
||
|
|
---
|
||
|
|
ui/vnc.c | 5 +++++
|
||
|
|
1 file changed, 5 insertions(+)
|
||
|
|
|
||
|
|
diff --git a/ui/vnc.c b/ui/vnc.c
|
||
|
|
index 3cb24badf6..667db3b990 100644
|
||
|
|
--- a/ui/vnc.c
|
||
|
|
+++ b/ui/vnc.c
|
||
|
|
@@ -2458,6 +2458,11 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
|
||
|
|
}
|
||
|
|
|
||
|
|
if (read_s32(data, 4) < 0) {
|
||
|
|
+ if (!vnc_has_feature(vs, VNC_FEATURE_CLIPBOARD_EXT)) {
|
||
|
|
+ error_report("vnc: extended clipboard message while disabled");
|
||
|
|
+ vnc_client_error(vs);
|
||
|
|
+ break;
|
||
|
|
+ }
|
||
|
|
if (dlen < 4) {
|
||
|
|
error_report("vnc: malformed payload (header less than 4 bytes)"
|
||
|
|
" in extended clipboard pseudo-encoding.");
|
||
|
|
--
|
||
|
|
2.41.0.windows.1
|
||
|
|
|