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
This commit is contained in:
parent
c94c6b6940
commit
df871b442a
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user