aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrangé <berrange@redhat.com>2024-01-15 09:51:19 +0000
committerMichael Tokarev <mjt@tls.msk.ru>2024-02-20 18:45:16 +0300
commit7e86bd83fdfbcce90982a53f7156f44190301c2c (patch)
treec5f2ea92c746c9c70ca1d6ea870fe9c8275da64f
parent373c7193dc36c38bf85df3087fd9bc461b1435d2 (diff)
ui: reject extended clipboard message if not activated
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: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r--ui/vnc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/vnc.c b/ui/vnc.c
index 1ca16c0ff6..629a500adc 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -2456,6 +2456,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.");