diff options
author | Pierre Ossman <ossman@cendio.se> | 2019-05-02 12:32:03 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2019-07-01 10:38:35 +0200 |
commit | 546b2ad80a68e80a737aade06f0685cccb5e9716 (patch) | |
tree | 60c577e30c103c16175047ea11c2bcee2b101258 /common/rfb/SMsgReader.cxx | |
parent | 2ff61a285efda80cca7f1855aca23b99149bac8c (diff) | |
download | tigervnc-546b2ad80a68e80a737aade06f0685cccb5e9716.tar.gz tigervnc-546b2ad80a68e80a737aade06f0685cccb5e9716.zip |
Make sure clipboard uses \n line endings
This is required by the protocol so we should make sure it is
enforced. We are tolerant of clients that violate this though and
convert incoming clipboard data.
Diffstat (limited to 'common/rfb/SMsgReader.cxx')
-rw-r--r-- | common/rfb/SMsgReader.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/common/rfb/SMsgReader.cxx b/common/rfb/SMsgReader.cxx index 200350c1..0c0e8b26 100644 --- a/common/rfb/SMsgReader.cxx +++ b/common/rfb/SMsgReader.cxx @@ -212,10 +212,10 @@ void SMsgReader::readClientCutText() vlog.error("Cut text too long (%d bytes) - ignoring", len); return; } - CharArray ca(len+1); - ca.buf[len] = 0; + CharArray ca(len); is->readBytes(ca.buf, len); - handler->clientCutText(ca.buf, len); + CharArray filtered(convertLF(ca.buf, len)); + handler->clientCutText(filtered.buf, strlen(filtered.buf)); } void SMsgReader::readQEMUMessage() |