diff options
author | bapt <bapt@FreeBSD.org> | 2015-08-08 23:59:15 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2015-08-08 23:59:15 +0000 |
commit | df871b442a50fbf3cc4d8c19deb60a0af5121a8e (patch) | |
tree | 01a3511f9f0c8047a6a7cabf84da84d7877ad6bd | |
parent | c94c6b6940610de486529b5d92fbcbd92347aa67 (diff) | |
download | FreeBSD-src-df871b442a50fbf3cc4d8c19deb60a0af5121a8e.zip FreeBSD-src-df871b442a50fbf3cc4d8c19deb60a0af5121a8e.tar.gz |
Remove 5 and 6 bytes sequences which are illegal in UTF-8 space.
Per rfc3629 value greater than 0x10ffff should be rejected
Suggested by: jilles
-rw-r--r-- | lib/libc/locale/utf8.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c index ce49279..843d59f 100644 --- a/lib/libc/locale/utf8.c +++ b/lib/libc/locale/utf8.c @@ -145,14 +145,6 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mask = 0x07; want = 4; lbound = 0x10000; - } else if ((ch & 0xfc) == 0xf8) { - mask = 0x03; - want = 5; - lbound = 0x200000; - } else if ((ch & 0xfe) == 0xfc) { - mask = 0x01; - want = 6; - lbound = 0x4000000; } else { /* * Malformed input; input is not UTF-8. |