summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authortrhodes <trhodes@FreeBSD.org>2006-03-30 09:04:12 +0000
committertrhodes <trhodes@FreeBSD.org>2006-03-30 09:04:12 +0000
commitdba9e095d481ec8f3fae72a3ca12ac6bc8e61664 (patch)
treeb7f7d0159026bf52a5148164d15f84b0f4d8b06d /lib
parent67e675ade087cff315601677e19b175c83150962 (diff)
downloadFreeBSD-src-dba9e095d481ec8f3fae72a3ca12ac6bc8e61664.zip
FreeBSD-src-dba9e095d481ec8f3fae72a3ca12ac6bc8e61664.tar.gz
Fix a bug where, for 6-byte sequences, the top 6 bits get compared to
111111 rather than the top 7 bits being compared against 1111110 causing illegal bytes fe and ff being treated the same as legal bytes fc and fd.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/locale/utf8.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c
index 2f537a5..e467fc0 100644
--- a/lib/libc/locale/utf8.c
+++ b/lib/libc/locale/utf8.c
@@ -140,7 +140,7 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n,
mask = 0x03;
want = 5;
lbound = 0x200000;
- } else if ((ch & 0xfc) == 0xfc) {
+ } else if ((ch & 0xfe) == 0xfc) {
mask = 0x01;
want = 6;
lbound = 0x4000000;
OpenPOWER on IntegriCloud