Author: bapt
Date: Sat Aug  8 23:59:15 2015
New Revision: 286490
URL: https://svnweb.freebsd.org/changeset/base/286490

Log:
  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

Modified:
  head/lib/libc/locale/utf8.c

Modified: head/lib/libc/locale/utf8.c
==============================================================================
--- head/lib/libc/locale/utf8.c Sat Aug  8 23:26:11 2015        (r286489)
+++ head/lib/libc/locale/utf8.c Sat Aug  8 23:59:15 2015        (r286490)
@@ -145,14 +145,6 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, 
                        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.
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to