diff options
author | Pierre Ossman <ossman@cendio.se> | 2020-10-05 16:07:27 +0200 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2020-10-05 16:07:27 +0200 |
commit | 703eb4d13016090d1b50294faaf9b57c6ed9a738 (patch) | |
tree | 6728eff052741d895166cb9262f7f335f1895858 /common | |
parent | d163da9ac89b2587401cd42e9a21309d1ba8fa3f (diff) | |
download | tigervnc-703eb4d13016090d1b50294faaf9b57c6ed9a738.tar.gz tigervnc-703eb4d13016090d1b50294faaf9b57c6ed9a738.zip |
Correctly handle invalid UTF-16 code points
Some code points are reserved for the UTF-16 coding itself and must not
appear as input data to the algorithm.
Diffstat (limited to 'common')
-rw-r--r-- | common/rfb/util.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/rfb/util.cxx b/common/rfb/util.cxx index cc5b7690..ecab8485 100644 --- a/common/rfb/util.cxx +++ b/common/rfb/util.cxx @@ -314,7 +314,7 @@ namespace rfb { *dst++ = src; *dst++ = L'\0'; return 1; - } else if (src < 0x110000) { + } else if ((src >= 0x10000) && (src < 0x110000)) { src -= 0x10000; *dst++ = 0xd800 | ((src >> 10) & 0x03ff); *dst++ = 0xdc00 | (src & 0x03ff); |