diff options
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/Viewport.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index c501764a..ff85ee5d 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -567,6 +567,11 @@ int Viewport::handle(int event) switch (event) { case FL_PASTE: + if (!isValidUTF8(Fl::event_text(), Fl::event_length())) { + vlog.error("Invalid UTF-8 sequence in system clipboard"); + return 1; + } + filtered = convertLF(Fl::event_text(), Fl::event_length()); vlog.debug("Sending clipboard data (%d bytes)", (int)filtered.size()); |