diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2019-03-14 15:01:27 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2019-03-14 17:25:24 (GMT) |
commit | a11e5e021b5c30a0d6490cfff0399a14a3fb798a (patch) | |
tree | d543d1dda68ddef6b7fb18ce4c1cb0c9b09a295b /Source/cm_utf8.c | |
parent | 7111873efd91c4ed7c38af117e50ff2ea4d8f0e5 (diff) | |
download | CMake-a11e5e021b5c30a0d6490cfff0399a14a3fb798a.zip CMake-a11e5e021b5c30a0d6490cfff0399a14a3fb798a.tar.gz CMake-a11e5e021b5c30a0d6490cfff0399a14a3fb798a.tar.bz2 |
cm_utf8: reject UTF-16 surrogate half codepoints
Diffstat (limited to 'Source/cm_utf8.c')
-rw-r--r-- | Source/cm_utf8.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cm_utf8.c b/Source/cm_utf8.c index 52af4a6..2459c02 100644 --- a/Source/cm_utf8.c +++ b/Source/cm_utf8.c @@ -71,6 +71,11 @@ const char* cm_utf8_decode_character(const char* first, const char* last, return 0; } + /* UTF-16 surrogate halves. */ + if (0xD800 <= uc && uc <= 0xDFFF) { + return 0; + } + *pc = uc; return first; } |